Skip to content

Allow empty token endpoint for implicit flow#45038

Merged
jkakavas merged 4 commits intoelastic:masterfrom
jkakavas:oidc-token-implicit
Aug 8, 2019
Merged

Allow empty token endpoint for implicit flow#45038
jkakavas merged 4 commits intoelastic:masterfrom
jkakavas:oidc-token-implicit

Conversation

@jkakavas
Copy link
Copy Markdown
Contributor

When using the implicit flow in OpenID Connect, the
op.token_endpoint_url should not be mandatory as there is no need
to contact the token endpoint of the OP.

When using the implicit flow in OpenID Connect, the
op.token_endpoint_url should not be mandatory as there is no need
to contact the token endpoint of the OP.
@jkakavas jkakavas added >bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v8.0.0 v7.4.0 labels Jul 31, 2019
@jkakavas jkakavas requested a review from tvernum July 31, 2019 12:20
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-security

String tokenEndpointString = config.getSetting(OP_TOKEN_ENDPOINT);
if (responseType.equals("code") && tokenEndpointString.isEmpty()) {
throw new SettingsException("The configuration setting [" + OP_TOKEN_ENDPOINT.getConcreteSettingForNamespace(name()).getKey()
+ "] is required when [" + RP_RESPONSE_TYPE.getConcreteSettingForNamespace(name()).getKey() + " is set to \"code\"");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ "] is required when [" + RP_RESPONSE_TYPE.getConcreteSettingForNamespace(name()).getKey() + " is set to \"code\"");
+ "] is required when [" + RP_RESPONSE_TYPE.getConcreteSettingForNamespace(name()).getKey() + "] is set to \"code\"");

URI tokenEndpoint;
try {
tokenEndpoint = new URI(require(config, OP_TOKEN_ENDPOINT));
tokenEndpoint = new URI(tokenEndpointString);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense for tokenEndpoint to be null (rather than an empty URI) if tokenEndpointString is empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, thanks

@jkakavas jkakavas requested a review from tvernum August 6, 2019 09:32
Copy link
Copy Markdown
Contributor

@tvernum tvernum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jkakavas
Copy link
Copy Markdown
Contributor Author

jkakavas commented Aug 7, 2019

@elasticmachine test this please

@jkakavas
Copy link
Copy Markdown
Contributor Author

jkakavas commented Aug 7, 2019

@elasticmachine update branch

@jkakavas
Copy link
Copy Markdown
Contributor Author

jkakavas commented Aug 7, 2019

@elasticmachine run elasticsearch-ci/1

@jkakavas jkakavas merged commit 76352da into elastic:master Aug 8, 2019
jkakavas added a commit that referenced this pull request Aug 8, 2019
When using the implicit flow in OpenID Connect, the
op.token_endpoint_url should not be mandatory as there is no need
to contact the token endpoint of the OP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v7.4.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants