-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support implicit grant flow #22
Comments
grant_type implicit is intentionally not supported because implicit flow is depreciated and recommended to not be used by the OpenIdConnect governing authority. It must use PKCE . Note that authorization code flow is now supported by google. |
Hi @jhancock4d, thanks for your response! You're right implicit flow is deprecated but sadly google does not yet support the auth code flow with PKCE. So this would require me to store the client secret in a js client for example: https://developers.google.com/identity/openid-connect/openid-connect I think this is why they still recommend the implicit flow for javascript clients: https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow If you have any idea on how to use PKCE with google your help would be greatly appreciated! |
I am planning on adding support for implicit flow for the reasons you have mentioned @fdaugs |
Ah awesome! Thank you 🙏 |
Please do not. Implicit flow is dead and insecure and should never be used for anything. Yes, google requires you to pass the client secret when using PKCE, but it doesn't make it any less secure in a public environment. It's still MORE secure than implicit flow without a client secret. According to the docs, just setup a separate web client id and secret with PKCE and use it per their docs. |
@jhancock4d I think the security part should be left to the Identity Provider, not the Relying Party to decide. |
Depreciated means depreciated as in not supported for any new uses. You don't add stuff that is broken to an existing library by definition. If someone wants Google auth, there is an entire package that Google provides for flutter that does it. If you're using just google, you should be using their library that just works. If you're not using just google and you're doing multiple different ways of SSO, then you should be using your own Idp and doing pass through to those providers as necessary and capturing the auth information on the way back and maintaining that information in your Idp per the best practices for OpenIdConnect. Thus there is no case where there is any reason at all to use this library and add depreciated and recommended not to use functionality to the spec. And if someone insists on ignoring those best practices, there is a work around: PKCE with Client Secret which is still more secure than implicit flow so this isn't even blocking. |
actually one might argue otherwise. A lot of developers want full control of the Auth UI, and I believe having a single library that can adapt to all the available IdP flows without switching between different SDKs is better However, I can understand why you don't want to support implicit flow, and it's ok with me |
I.e. there is both no reason to have a client secret on a browser in PKCE and google shouldn't be requiring it, but also, it doesn't matter that there is a client secret that is public because it makes the flow no less secure on the given platform (browser) than any other alternative and because PKCE validates the flow, it's massively more secure than implicit in all cases even with exposed client secret. So, the correct answer is to include your client secret to placate google and then not care about it because you're still better off. And again: If you're just doing google, then just do google with their library. If you're doing many SSOs then you should be doing as Gitlab and literally every other service that does SSO does and proxy the result through your own IdP. They are not sending users directly to the 3rd party and then blindly trusting the JWT tokens that come back for multiple reasons:
This is well covered and documented in C# server side as a small example with proper flows that should be used. |
I think we can agree, that Google is the Problem here :D Even Microsoft supports PKCE. The weird thing is, that they support it for mobile clients: https://developers.google.com/identity/protocols/oauth2/native-app#step1-code-verifier Using the client secret approach is not an option for me, so I won't support Google Login... |
Why isn't client secret separate for web an option? There is 0 more risk than your request for implicit flow. In fact vastly less. Just don't share the same client secret between platforms. |
I will look into it. Thanks! |
Currently this package does not work with Google (e.g. Google Workspace) as IdP for a web app, because accounts.google.com only supports the authorization code flow with PKCE for mobile clients (iOS and Android). If you create an OAuth-ClientId of type "Web-Application" and configure the plugin with:
The request fails with an error, that
grant_type
is an unsupported parameter. If I alter the code of this plugin to omit thegrant_type
parameter the, login screen is shown correctly but the code exchange on the token endpoint fails, because it expects a Client ID.The text was updated successfully, but these errors were encountered: