Overview
In the process of authenticating a user, theredirectURI
parameter is utilized as a callback URL and will redirect users once the authentication is complete. For Magic, this is only relevant when using an OAuth provider (such as Google) as your user’s authentication method. For OAuth, when using the loginWithCredential
feature, you have the option to include a redirectURI
value. If you do not include a redirectURI
, the user will be asked to go back to the original tab to complete the login process. It’s recommended to use a redirectURI for a smoother user experience.
Configuration
- Go to the settings page of your app in the developer dashboard
- Toggle on your ‘redirect allowlist’
- Add your redirects and save your changes
Format
Several redirect formats are supported, generically it may look similar to the following:<scheme> "://" <host> [ ":" <port> ] <path>
Mobile Linking
Linking in mobile applications refers to the ability to navigate users to a specific location within an application by clicking on a link. There are two main methods of linking in mobile apps: Deep linking and Universal Links (App Links on Android). We recommend using Universal Links/App Links for increased security in lieu of Deep Links. View our guide on mobile links in your Magic Application Some examples:- Web:
https://example.link
https://example.link/path1
- iOS deep links:
myphotoapp:albumname
expo://
- Android app links:
app://www.example.com
app://open.my.app
- All paths have to be explicit, ie.
https://example.link
does not also whitelisthttps://example.link/path1
- Query strings and hash information are not taken into account when validating these URLs
- You can use wildcards at the subdomain level (e.g.: https://*.contoso.com)
Programmatic Configuration
Alternatively, redirectURIs can be added to your applications allowlist using Curl. In order to interact with the email access control list for your application using Curl, you will need a Secret Key and Client ID. To obtain the required information, follow the steps below:- On the Dashboard landing page, right-click anywhere and select Inspect
- Navigate to the Network tab and look for
info?magic_client_id=<CLIENT_ID>
- Navigate to the Response tab and extract
live_secret_key
as your Secret Key andmagic_client_id
as your Client ID