If anyone have implemented or have any idea about,...
# talk-hydra
l
If anyone have implemented or have any idea about, What's the best way to do OAuth2 in android app(I'm using flutter). I see people putting client credentials inside the app, is it even safe? Do we need to have a server handling all logic and use it for redirections, etc? Any resource to the flow diagram will be helpful for me.
n
the generally accepted approach is authorization code with pkce with a public client (i.e. no secret), since mobile apps technically can’t store secrets as the client runs on a device you don’t control
you could also take a look at dynamic client registration, which would let you create private clients for each device
i don’t claim to be an expert however, as we’re currently in the middle of this implementation as well, but i have been reading quite a bit about it, it’s especially difficult as the “right way” seems to change quite often as new standards are released, so it’s easy to find outdated recommendations when searching
l
@numerous-umbrella-61726, any preferred resources for this?
n
ory themselves posted a good blog post on it - https://www.ory.sh/oauth2-for-mobile-app-spa-browser/
there’s also https://oauth.net/2/native-apps/ if you want a more “official” reference, since that links to the ietf recommendation