com.auth0samples.auth0://labs-fundtraining.us.auth0.com/ios/com.auth0samples/callback
com.auth0samples.auth0://labs-fundtraining.us.auth0.com/android/com.auth0samples/callback
ios
folder and run pod install
.build.gradle
file in your application directory (typically at
android/app/build.gradle
) and add the following manifest placeholders. The value for
auth0Domain
should contain your Auth0 application settings as configured above.applicationId
value will automatically update with your application’s
package name or ID (e.g. com.example.app
). You can change this value from the
build.gradle
file. You can also check it at the top of your
AndroidManifest.xml
file.ios/<YOUR PROJECT>/AppDelegat.swift
) add the following in
AppDelegate
class:ios/<YOUR PROJECT>/AppDelegate.mm
) add the following:ios/<YOUR PROJECT>/AppDelegate.m
on applications using the old architecture.ios
folder, open the Info.plist
and locate the value for
CFBundleIdentifier
.CFBundleIdentifier
as the value for
the CFBundleURLSchemes
.$(PRODUCT_BUNDLE_IDENTIFIER)
dynamically matches
org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
. For the sample app, this
value matches com.auth0samples
.ios/<YOUR PROJECT>.xcodeproj
file or run xed ios
on a Terminal from
the app root.useAuth0
hook relies on a React Context to provide state management. The
Auth0Provider
component provides this context.Import the useAuth0
hook and Auth0Provider
component from the
react-native-auth0
package:Auth0Provider
component and set the
following properties:domain
: The domain of your Auth0 tenant. Generally, you can find this in the Auth0 Dashboard
under your Application’s Settings in the Domain field. If you are using a custom domain, you should set this to the value of your
custom domain instead.clientId
: The ID of the Auth0 Application you set up earlier in this quickstart. You can find
this in the Auth0 Dashboard under your application’s Settings tab in the Client ID field.Auth0Provider
component. Run your application to verify that:authorize
method provided by the useAuth0
hook.
This method redirects the user to the Auth0 Universal
Login page for authentication, then back to your app.To confirm the user successfully logged in, check that the user
property provided by the hook is not
null
.authorize
when clicked. Verify that you are redirected to
the login page and then back to your application.clearSession
. This will
remove their session from the authorization server and log the user out of the application.clearSession
and observe that you are redirected to the Auth0 logout
endpoint and back again. You should no longer be logged in to your application.useAuth0
hook exposes a user
object that contains information about the
authenticated user. You can use this to access decoded user profile information about the authenticated user from
the ID token.If a user has not been authenticated, this property will be null
.user
property on the result. Verify the current user’s profile
information, such as email
or name
.