GithubHelp home page GithubHelp logo

oktadev / okta-ionic-social-login-example Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 2.0 3.68 MB

Ionic + Sign in with Apple and Google

Home Page: https://developer.okta.com/blog/2020/09/21/ionic-apple-google-signin

License: Apache License 2.0

JavaScript 3.27% TypeScript 60.43% HTML 8.79% Swift 7.25% Ruby 1.32% Java 3.18% SCSS 15.75%
ionic ionic-framework angular sign-in-with-apple sign-in-with-google sign-in-with-okta

okta-ionic-social-login-example's Introduction

Ionic + Sign in with Apple and Google

Please read Ionic + Sign in with Apple and Google to read about how this app was created.

Getting Started

Prerequisites:

Clone this application to your local hard drive using Git.

git clone https://github.com/oktadeveloper/okta-ionic-social-login-example.git

Or use the GitHub CLI:

gh repo clone oktadeveloper/okta-ionic-social-login-example

Install this example's dependencies:

cd okta-ionic-social-login-example
npm i

Use Okta for Identity

You will need to create an OIDC Application in Okta to get your configuration settings to log in. You'll need to create an Okta developer account and register your app to get a client ID. Head on over to developer.okta.com/signup if you'd like to do this in your browser.

If you prefer the command line, install the Okta CLI. Run okta register to sign up for a new account.

Log in to your Okta Developer account or use okta apps create. If you use your browser, go to Applications > Add Application.

On the Create New Application page, select Native. Name your app Ionic Social, and configure it as follows:

  • Login redirect URIs:
    • http://localhost:8100/callback
    • com.okta.dev-133337:/callback (where dev-133337.okta.com is your Okta Org URL)
  • Logout redirect URIs:
    • http://localhost:8100/logout
    • com.okta.dev-133337:/logout
  • Grant type allowed:
    • Authorization Code
    • Refresh Token
  • Click Done

Run ionic serve and open http://localhost:8100 in a new incognito window. Click Login to sign in to your Okta developer account.

Links

This example uses the following open source libraries:

Help

Please post any questions as issues in this forum, as questions on the blog post, or on Stack Overflow with an "okta" tag.

License

Apache 2.0, see LICENSE.

okta-ionic-social-login-example's People

Contributors

imgbotapp avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

okta-ionic-social-login-example's Issues

Using Example on Native with API Calls

When trying to add an API call to the example, I've been running into an issue with the HttpClient and/or ionic-native/http.

Since I started this as a web app, I initially used HttpClient thinking it was a universal option. Once I tried migrating the app to iOS, I realized that HttpClient creates CORS issues and isn't really a viable option. I started trying to migrate to ionic-native/http/ngx. However, if I use @ionic-native/http/ngx and load it in via the app.module, I get Error: Unable To Obtain Server Configuration on app load. I'm assuming there is some collision between the way the okta widget tries to load via the URL that causes an issue, but I am well beyond my depth.

My next attempt was to build an interceptor to convert the HttpClient calls over to a native, but I haven't been successful.

Is there an easy way to import the native http?

I stumbled across this: https://github.com/wi3land/ionic-appauth-capacitor-demo/issues/2 but the suggestion to just import without the ngx doesn't seem to work and goes against the ionic documentation.

Android Redirect

In your instructions, you mention needing to add the okta redirect to the info.plist for iOS. Is there a similar step needed for android's build.gradle files? I get to the point where I log in on android, but it won't redirect back to the application.

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.