Integrate react-native with civic-auth OAuth2 services.
https://auth.civic.com/oauth/auth
https://auth.civic.com/oauth/token
https://auth.civic.com/oauth/userinfo
openid profile email
AuthContext
// Uses expo-auth-session for OAuth2 flow const [request, response, promptAsync] = useAuthRequest( { clientId: config.clientId, scopes: ["openid", "profile", "email"], redirectUri: config.redirectUri, usePKCE: true, // Required by Civic Auth }, { authorizationEndpoint: config.authorizationEndpoint, tokenEndpoint: config.tokenEndpoint, }, ); // Authentication methods const authContext = { signIn: () => promptAsync(), signOut: async () => { // Clear tokens and end remote session }, state: { isAuthenticated, user, accessToken }, };
Was this page helpful?