# Auth using Phoenix API with React Native frontend in a separate code base

**URL:** <https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793>\
**Category:** Questions\
**Tags:** authentication, api, phoenix, authorization, react-native\
**Created:** [October 8, 2023, 5:48pm UTC](https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793 "2023-10-08T17:48:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MDodge](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/58956e/32.png) [@MDodge](https://forum.elixirforum.com/u/MDodge)\
**Post date:** [October 8, 2023, 5:48pm UTC](https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793/1 "2023-10-08T17:48:39Z")

</div>

Hey all,

I’m writing an app using Phoenix as an API and I have a separate codebase for React Native.

I’m researching the best way to handle Auth in this scenario. I’ve been looking around quite a bit and I’m coming up with a lot of different answers, and I’m struggling to distill it down into the best direction.

I’d like users to be able to sign up in a traditional way with UN/PW, but I plan to implement OAUTH and allow users to register with Google and Apple as well.

What are the current best options for this scenario?

---

<div class="post-metadata">

**Author:** ![kokolegorille](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kokolegorille/32/4784_2.png) [@kokolegorille](https://forum.elixirforum.com/u/kokolegorille)\
**Post date:** [October 8, 2023, 5:50pm UTC](https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793/2 "2023-10-08T17:50:50Z")

</div>

Hi and welcome,

Probably this can help…

> **[ueberauth](https://hex.pm/packages/ueberauth)**
>
> An Elixir Authentication System for Plug-based Web Applications

---

<div class="post-metadata">

**Author:** ![MDodge](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/58956e/32.png) [@MDodge](https://forum.elixirforum.com/u/MDodge)\
**Post date:** [October 8, 2023, 6:43pm UTC](https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793/3 "2023-10-08T18:43:36Z")

</div>

Thank you!

I’ve seen this mentioned.

So, I should use that for the initial authorization and then Guardian for handling request authentication. That makes sense.

I appreciate the response!

---

<div class="post-metadata">

**Author:** ![experimentix](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@experimentix](https://forum.elixirforum.com/u/experimentix)\
**Post date:** [October 9, 2023, 12:37pm UTC](https://forum.elixirforum.com/t/auth-using-phoenix-api-with-react-native-frontend-in-a-separate-code-base/58793/4 "2023-10-09T12:37:08Z")

</div>

Hi

I’m building same thing as you, api and backend in phoenix and for the app react native.  
How would you use uberauth as initial authorization???

Im still learning both elixir/phoenix and react native and for what i’ve seen the social login would be made in the app and after response we could communicate with the api (guardian) creating a new user or logging in the existing one
