Giter VIP home page Giter VIP logo

appauthsampleswift's Introduction

AppAuthSampleSwift

AppAuth Example Project using Swift

Configuration

The example doesn't work out of the box, you need to configure it your own client ID.

Creating a Google OAuth Client

To configure the sample with a Google OAuth client, visit https://console.developers.google.com/apis/credentials?project=_ and create a new project. Then tap "Create credentials" and select "OAuth client ID". Follow the instructions to configure the consent screen (just the Product Name is needed).

Then, complete the OAuth client creation by selecting "iOS" as the Application type. Enter the Bundle ID of the project (net.openid.appauth.Example by default, but you may want to change this in the project and use your own Bundle ID).

Copy the client ID to the clipboard.

Configure the Example

In AppAuthSwiftSampleViewController.swift update kClientID with your new client id.

In the same file, update kRedirectURI with the reverse DNS notation form of the client ID. For example, if the client ID is YOUR_CLIENT.apps.googleusercontent.com, the reverse DNS notation would be com.googleusercontent.apps.YOUR_CLIENT. A path component is added resulting in com.googleusercontent.apps.YOUR_CLIENT:/oauthredirect.

Finally, open Info.plist and fully expand "URL types" (a.k.a. "CFBundleURLTypes") and replace com.googleusercontent.apps.YOUR_CLIENT with the reverse DNS notation form of your client id (not including the :/oauthredirect path component).

Once you have made those three changes, the sample should be ready to try with your new OAuth client.

appauthsampleswift's People

Contributors

kamaldheeraj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.