Skip to content

lapinek/oauth-2-universal-links

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Testing OAuth 2.0 Redirection with Universal Links

This is a quick demonstration of using Universal Links for OAuth 2.0 redirection. It is NOT suited for any kind of practical application and does not go beyond visiting the authorization endpoint.

Two examples are provided and commented on in the code, and you should be able to try your own Identity Provider and Universal Links setup.

You will need:

  1. Join Apple Developer Program

    You will need to associate you project with a development team account and provide the team ID in your Apple App Site Association file, as a part of your app identifier.

  2. Enable Universal Links

    You will need to add your Universal Links associated domain to the app.

  3. Create an OAuth 2.0 client

    For example, Google can serve as a provider. For testing Universal Links with Google, you will need an OAuth client ID of the Web application type. Choosing the iOS option will let you use a custom scheme only.

  4. Provide your provider and client details, for example:

    // ViewController.swift
    
    // . . .
    
    authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth"
    clientId = "your-client.apps.googleusercontent.com"
    redirectUri = "https://your-associated-domain/your-redirection-path"
    
    // . . .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages