capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
234 stars 115 forks source link

Feat: Support Resource Owner Password Credentials Grant flow #117

Open kevinboosten opened 4 years ago

kevinboosten commented 4 years ago

Describe the Feature

Make it possible to authorize with the Authorization Server based on username + password when there's a "trust relationship" between resource owner and the client. This is most of the time probably not the preferred grant type. But when you need it, it would be nice if we could use it via this plugin :-)

Platform(s) Support Requested

Describe Preferred Solution

Make it possible to use this library to also authorize based on username + password next to the already available grant types.

Describe Alternatives

Related Code

Additional Context

Make password grant flow from underlying OAuth libraries available in Capacitor plugin

moberwasserlechner commented 4 years ago

Hi, what providers support this flow or with what provider do you plan to use this flow?

kevinboosten commented 4 years ago

Auth0 and Azure B2C do support this flow. But at the moment I need it for a client that has its own identity provider. They use the password grant for now, but I can imagine that this will eventually change to Authorization Code + PKCE flow because it's a (trusted) mobile application. Only require a single plugin for both flows, instead of a own http implementation, would obviously be easier at the end :-)

doublechecker commented 2 years ago

We do also need this. In our app we have a Keycloak instance with idp for google and apple. From UX perspective we decided that users should not be redirected to the Keycloak instance to login with our "in house" user-management but instead login from within the SPA directly. Looking forward to this feature :D