-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular ionic sample #21
Comments
What are you trying to accomplish ? On Mobile Android you could use the Google APIs (Google Sign In) which is native, and gives you the functionality you need. If you want to support a non GMS device, you could also consider using AppAuth-Android. |
Thanks,
I am trying to implement a login on an ionic 3 mobile app for both android and IOS that will connect to an identity server 4 API backend.
I will like to use a js library directly instead of the google signins which I believe is native to android.
Also ,this should also work in pwa mode as the app will have a base and be built for both android,IOS and web
…Sent from my Windows Phone
-----Original Message-----
From: "Rahul Ravikumar" <notifications@github.com>
Sent: 9/1/2017 5:10 AM
To: "openid/AppAuth-JS" <AppAuth-JS@noreply.github.com>
Cc: "layinka" <xcelsis02@gmail.com>; "Author" <author@noreply.github.com>
Subject: Re: [openid/AppAuth-JS] Angular ionic sample (#21)
What are you trying to accomplish ? On Mobile Android you could use the Google APIs (Google Sign In) which is native, and gives you the functionality you need. If you want to support a non GMS device, you could also consider using AppAuth-Android.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry about the delay in replying. For an ionic app, you will have to implement the hooks for launching a custom tab, and handling the redirect either via a Universal URL or an Intent on Android. The key is to implement another |
@layinka if you have more questions please feel free to re-open this issue. |
@layinka any progress? |
@BenjaminKauer I wrote an article that shows how to do Ionic authentication with OAuth, maybe you'll find it useful. It doesn't use AppAuth-JS, but it'll get the job done. I also integrated something similar in the Ionic Module for JHipster, but ended up using angular-oauth2-oidc so it'd work with Okta and Keycloak. You can read about how it works in this blog post. Someone recently contributed a way to make it even better by recognizing existing authenticated sessions. |
@mraible Thank you very much. We don't want to use a third-party service as Okta, though. Furthermore we need to implement the Hybrid Flow. It's interesting, that I can't find anyone who has done this before: OIDC Hybrid Flow in Ionic/Angular, using their own IdentityServer. |
@BenjaminKauer I've been at the exact same task the last couple of hours. Currently considering doing the implementation myself with the InApp browser |
@Belicosus that's the way I'll do it. But I spent a little time with our backend people to discuss whether we could use another flow. Edit: We're using the Authorization Code Flow with PKCE and Silent Refresh. |
@mraible Actually I reviewed your guide and I have a question: The access token gets expired. How do you you refresh it in an hybrid(Ionic) Android application using angular-oauth2-oidc ? I have the same issue like @layinka and I am thinking to try AppAuth-JS |
angular-auth-aoidc has a silent refresh feature you might be able to use.
… On Feb 26, 2018, at 6:22 AM, Kostas Johnson ***@***.***> wrote:
@mraible <https://github.com/mraible> Actually I reviewed your guide and I have a question: The access token gets expired. How do you you refresh it in an hybrid(Ionic) Android application using angular-oauth2-oidc ? I have the same issue li @layinka <https://github.com/layinka> and I am thinking to try AppAuth-JS
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#21 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABF5AggEIEh1EP3KR_veEcV-m36KpSHks5tYq_5gaJpZM4PJY46>.
|
@mraible I think you cannot use the silent refresh feature in Ionic (Android or iOS) application app. You cannot setup the silent refresh process for many reasons. It opens a hidden iframe and follows the implicit login process I think. For example you cannot use iframes that required by the silent refresh process (thats why an in-app browser is used). If you have implemented it you can share it. It will be a great help for many developers. |
@kioannou Good point. I don't have a solution at this time. |
I've started work on a Ionic wrapper for AuthApp. The implementation is very much inspired by @mraible and his article pointing to the use of InAppBrowser to sign in with Facebook. |
@Belicosus if you're going to spend the time doing the work, I would kindly suggest looking into using a custom URL scheme, rather than using the InAppBrowser. Google's no longer supports authentication using the InAppBrowser and it's not longer the recommended approach for several reasons. Jacques has an an old (but nonetheless relevant) article on medium that's a pretty nice read. |
@Belicosus You might look at react-native-app-auth for inspiration. That uses the custom URL scheme that @lostdev recommends. I wrote an article about it for scotch.io recently. |
Thanks for all the ideas. I've got an almost working solution for the Authorization Code Flow with PKCE and silent refresh. As soon as I'm done I'll probably write an article. FYI: I needed to implement a custom AuthorizationRequestHandler and a TokenRequestHandler. The latter is using a custom URL scheme and the system browser. |
Once you have an article, could you please link your article and the source code? That will help others who want to do something similar (implement their own |
Of course I will :) |
Hi all, are there any news about this issue? Thanks... |
@maurotn A project deadline has kept me from creating a usable package for this, but we did indeed implement the AppAuth JS library in our Ionic app. |
something like this
|
Thanks @Belicosus , yes I'm interested. If you had the time to upload it into a repo it would be great! |
Thanks @nmocruz |
@Belicosus would be grad if you could put that on github and we could maybe pull it up alltogether! |
@Belicosus @nmocruz Awesome work. If you create a GitHub repo, I can link it from this repo so others can discover it. |
@BenjaminKauer I am struggling to work AppAuth-Js with Identityserver3 to implement AuthorizationCode with PKCE. I am able to launch Login page but after successful login it is not redirecting but coming back to login page only. If you have completed your ionic example with PKCE can you please share it? There are so many days i have spent but totally stuck..please |
Hi guys. @maurotn @twinklekumarp It still needs some(a lot) polishing if we want to publish it as a npm package, but for now, it should at least get some of you going. Please feel free to post any questions in the issues section. @tikurahul Do whatever you want with the repo. I don't know if you want to link to it at it's current state. It's up to you 👍 |
@Belicosus Thank you for the link. I am going to link it off the |
I'm sorry I wasn't able to deliver my solution earlier. We've been busy implementing the EU-GDPR stuff. |
@BenjaminKauer Fell free to post any questions of suggestions under Issues, or even submit a PR. will be much appreciated :) |
Hi,
Do you have an example of how i can use this in a mobile android app for Ionic
The text was updated successfully, but these errors were encountered: