Skip to content

Commit

Permalink
Change callback URL content
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Jul 6, 2023
1 parent 2ae8287 commit 89a55a6
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 69 deletions.
38 changes: 13 additions & 25 deletions articles/quickstart/native/react-native-beta/00-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,41 +134,29 @@ Note this value as you'll be using it to define the callback URLs below. If desi

For additional information please read [react native docs](https://facebook.github.io/react-native/docs/linking).

<%= include('../../../_includes/_callback_url') %>

#### iOS callback URL
### Configure Callback and Logout URLs

```text
{PRODUCT_BUNDLE_IDENTIFIER}.auth0://${account.namespace}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
```
The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your application. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie.

Remember to replace `{PRODUCT_BUNDLE_IDENTIFIER}` with your actual application's bundle identifier name.
If the callback and logout URLs are not set, users will be unable to log in and out of the application and will get an error.

#### Android callback URL
Go to the settings page of your [Auth0 application](${manage_url}/#/applications/${account.clientId}/settings) and add the corresponding URL to **Allowed Callback URLs** and **Allowed Logout URLs**, according to the platform of your application. If you are using a [custom domain](/customize/custom-domains), use the value of your custom domain instead of the Auth0 domain from the settings page.

#### iOS
```text
{YOUR_APP_PACKAGE_NAME}.auth0://${account.namespace}/android/{YOUR_APP_PACKAGE_NAME}/callback
BUNDLE_IDENTIFIER.auth0://${account.namespace}/ios/BUNDLE_IDENTIFIER/callback
```

Remember to replace `{YOUR_APP_PACKAGE_NAME}` with your actual application's package name.

<%= include('../../../_includes/_logout_url') %>

#### iOS logout URL

#### Android
```text
{PRODUCT_BUNDLE_IDENTIFIER}.auth0://${account.namespace}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
PACKAGE_NAME.auth0://${account.namespace}/android/PACKAGE_NAME/callback
```

Remember to replace `{PRODUCT_BUNDLE_IDENTIFIER}` with your actual application's bundle identifier name.

#### Android logout URL

```text
{YOUR_APP_PACKAGE_NAME}.auth0://${account.namespace}/android/{YOUR_APP_PACKAGE_NAME}/callback
```

Remember to replace `{YOUR_APP_PACKAGE_NAME}` with your actual application's package name.
::: note
If you are following along with our sample project, set this
- for iOS - `com.auth0samples.auth0://${account.namespace}/ios/com.auth0samples/callback`
- for Android - `com.auth0samples.auth0://${account.namespace}/android/com.auth0samples/callback`
:::

## Add login to your app

Expand Down
2 changes: 1 addition & 1 deletion articles/quickstart/native/react-native-beta/files/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ language: javascript

```javascript
import React from 'react';
import {Button, Text, View} from 'react-native';
import {Button, Text, View, StyleSheet} from 'react-native';
import {useAuth0, Auth0Provider} from 'react-native-auth0';

const Home = () => {
Expand Down
43 changes: 15 additions & 28 deletions articles/quickstart/native/react-native-expo-beta/00-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ expo prebuild
You will be prompted to provide the [Android package](https://github.com/expo/fyi/blob/main/android-package.md) and [iOS bundle identifier](https://github.com/expo/fyi/blob/main/bundle-identifier.md) if they are not already present in the Expo config:

```bash
? What would you like your Android package name to be? > com.auth0samples
? What would you like your Android package name to be? > com.auth0samples # or your desired package name

? What would you like your iOS bundle identifier to be? > com.auth0samples
? What would you like your iOS bundle identifier to be? > com.auth0samples # or your desired bundle identifier
```

These values are found in the Expo config file at `app.json` or `app.config.js`. It will be used in the callback and logout URLs:
Expand All @@ -105,41 +105,28 @@ These values are found in the Expo config file at `app.json` or `app.config.js`.
}
```

<%= include('../../../_includes/_callback_url') %>
### Configure Callback and Logout URLs

#### iOS callback URL
The callback and logout URLs are the URLs that Auth0 invokes to redirect back to your application. Auth0 invokes the callback URL after authenticating the user, and the logout URL after removing the session cookie.

```text
{YOUR_CUSTOM_SCHEME}.auth0://${account.namespace}/ios/{IOS_BUNDLE_IDENTIFIER}/callback
```

Remember to replace `{IOS_BUNDLE_IDENTIFIER}` with your actual application's bundle identifier name.

#### Android callback URL

```text
{YOUR_CUSTOM_SCHEME}.auth0://${account.namespace}/android/{ANDROID_PACKAGE}/callback
```
If the callback and logout URLs are not set, users will be unable to log in and out of the application and will get an error.

Remember to replace `{ANDROID_PACKAGE}` with your actual application's package name.

<%= include('../../../_includes/_logout_url') %>

#### iOS logout URL
Go to the settings page of your [Auth0 application](${manage_url}/#/applications/${account.clientId}/settings) and add the corresponding URL to **Allowed Callback URLs** and **Allowed Logout URLs**, according to the platform of your application. If you are using a [custom domain](/customize/custom-domains), use the value of your custom domain instead of the Auth0 domain from the settings page.

#### iOS
```text
{YOUR_CUSTOM_SCHEME}.auth0://${account.namespace}/ios/{IOS_BUNDLE_IDENTIFIER}/callback
BUNDLE_IDENTIFIER.auth0://${account.namespace}/ios/BUNDLE_IDENTIFIER/callback
```

Remember to replace `{IOS_BUNDLE_IDENTIFIER}` with your actual application's bundle identifier name.

#### Android logout URL

#### Android
```text
{YOUR_CUSTOM_SCHEME}.auth0://${account.namespace}/android/{ANDROID_PACKAGE}/callback
PACKAGE_NAME.auth0://${account.namespace}/android/PACKAGE_NAME/callback
```

Remember to replace `{ANDROID_PACKAGE}` with your actual application's package name.
::: note
If you are following along with our sample project, set this
- for iOS - `com.auth0samples.auth0://${account.namespace}/ios/com.auth0samples/callback`
- for Android - `com.auth0samples.auth0://${account.namespace}/android/com.auth0samples/callback`
:::

## Add login to your app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: javascript

```javascript
import React from 'react';
import {Button, Text, View} from 'react-native';
import {Button, Text, View, StyleSheet} from 'react-native';
import {useAuth0, Auth0Provider} from 'react-native-auth0';

const Home = () => {
Expand Down
30 changes: 16 additions & 14 deletions articles/quickstart/native/react-native-expo-beta/interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,26 @@ Any settings you configure using this quickstart will automatically update for y

If you would rather explore a complete configuration, you can view a sample application instead.

### Configure Callback URLs
### Configure callback and logout URLs

A callback URL is the application URL that Auth0 will direct your users to once they have authenticated. If you do not set this value, Auth0 will not return users to your application after they log in.
Auth0 invokes the callback and logout URLs to redirect users back to your application. Auth0 invokes the callback URL after authenticating the user and the logout URL after removing the session cookie. If you do not set the callback and logout URLs, users will not be able to log in and out of the app, and your application will produce an error.

::: note
If you are following along with our sample project, set this
- for iOS - `auth0.com.auth0samples.auth0://${account.namespace}/ios/com.auth0samples/callback`
- for Android - `auth0.com.auth0samples.auth0://${account.namespace}/android/com.auth0samples/callback`
:::
Add the corresponding URL to **Callback URLs** and **Logout URLs**, according to your app's platform. If you are using a [custom domain](/customize/custom-domains), use the value of your custom domain instead of your Auth0 tenant’s domain.

### Configure Logout URLs
#### iOS
```text
BUNDLE_IDENTIFIER.auth0://${account.namespace}/ios/BUNDLE_IDENTIFIER/callback
```

A logout URL is the application URL Auth0 will redirect your users to once they log out. If you do not set this value, users will not be able to log out from your application and will receive an error.
#### Android
```text
PACKAGE_NAME.auth0://${account.namespace}/android/PACKAGE_NAME/callback
```

::: note
If you are following along with our sample project, set this
- for iOS - `auth0.com.auth0samples.auth0://${account.namespace}/ios/com.auth0samples/callback`
- for Android - `auth0.com.auth0samples.auth0://${account.namespace}/android/com.auth0samples/callback`
- for iOS - `com.auth0samples.auth0://${account.namespace}/ios/com.auth0samples/callback`
- for Android - `com.auth0samples.auth0://${account.namespace}/android/com.auth0samples/callback`
:::

## Install dependencies
Expand Down Expand Up @@ -94,12 +96,12 @@ You must generate the native code for the above configuration to be set. To do t
expo prebuild
```

You will be prompted to provide the [Android package](https://github.com/expo/fyi/blob/main/android-package.md) and [iOS bundle identifier](https://github.com/expo/fyi/blob/main/bundle-identifier.md) if they are not already present in the Expo config:
You will be prompted to provide the [Android package](https://github.com/expo/fyi/blob/main/android-package.md) and [iOS bundle identifier](https://github.com/expo/fyi/blob/main/bundle-identifier.md) if they are not already present in the Expo config.

```bash
? What would you like your Android package name to be? > com.auth0samples
? What would you like your Android package name to be? > com.auth0samples # or your desired package name

? What would you like your iOS bundle identifier to be? > com.auth0samples
? What would you like your iOS bundle identifier to be? > com.auth0samples # or your desired bundle identifier
```

These values are used to set the callback and logout URLs.
Expand Down

0 comments on commit 89a55a6

Please sign in to comment.