I have been doing quite a lot of research on this topic and I am left a little confused on how to go about it. My understanding is this:
To use Identity Server 4 with an android app, the best approach is to have the android app open an embedded browser instance that will render the identity server login page for the user where the user can log in. Upon the completion, the browser will close and a method will be called on the app to pass in the token(s) that are needed to access the apis and claims and what not. Now the part that confuses is me what type of client are we to use to accomplish this and what would the configuration for that client look like?
Here is a diagram of what I described above, if this is wrong please feel free to correct me.
The article where I got it from is: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-native-apps-09#section-4.1
I am using nativescript to build my app and I'm putting that out there because I'm not sure how much that will matter, so if you think it does please mention why.
The Implicit client is used for SPA applications and that is one of the clients I already have setup and working with my angular app. Now I'm trying to get it to work with the native script app but the options from what I'm reading are either GrantTypes.Hybrid
or GrantTypes.Code
Some of the answers I found say we should use Hybrid and others are saying we should use Code and I'm not sure which is correct and why?
The other thing that bothers me is how this is secure on the android app. With SPA and Implicit flow, we define the login and logout urls and as such those domains are white listed and will not work with any other which makes it secure. However, with android app how exactly does this gets secure? I can't store a secret on the phone because anyone then can dig it out, so what exactly about the flow (Hyrbrid or Code, depending on which I'm suppose to use) keeps it seure?