Skip to content
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

OIDC login implementation isn't up to standard #339

Open
oneonestar opened this issue May 9, 2024 · 0 comments · May be fixed by #345
Open

OIDC login implementation isn't up to standard #339

oneonestar opened this issue May 9, 2024 · 0 comments · May be fixed by #345
Assignees

Comments

@oneonestar
Copy link
Member

oneonestar commented May 9, 2024

Things that are missing:

  • unique session token that holds state
  • set and verify nonce and state during authentication

I think what I'm going to do is reimplement the OIDC login using OAuth library (nimbusds).


Ref:

"%s?client_id=%s&response_type=code&redirect_uri=%s&scope=%s",

$ curl -X POST http://localhost:9080/sso
{"code":200,"msg":"Ok","data":"http://localhost:4444/oauth2/auth?client_id=trino_client_id&response_type=code&redirect_uri=http://localhost:9080/oidc/callback&scope=openid"}

state should be included in the OAuth request redirect.
It is required by the spec and some OAuth provider reject the request if state field is missing.

For example, Hydra returns the following error:
The state is missing or does not have enough characters and is therefore considered too weak. Request parameter "state" must be at least be 8 characters long to ensure sufficient entropy.

Ref:

Implementation in Trino:
https://github.com/trinodb/trino/blob/ae789c04f5995dcd87efe6b5e1862521c2ad6957/core/trino-main/src/main/java/io/trino/server/security/oauth2/OAuth2Service.java#L151

@oneonestar oneonestar self-assigned this May 9, 2024
@oneonestar oneonestar changed the title state is missing in OAuth request redirect OIDC login implementation isn't up to standard May 10, 2024
@oneonestar oneonestar linked a pull request May 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant