-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Can API operations that create access tokens include respective full user info in the response? #59685
Comments
Pinging @elastic/es-security (:Security/Authentication) |
It should be relatively straightforward to add response of {
"access_token": "46ToAxZFNTJubnEwZVRwNmJIc1hUdEFVbGdB",
"type": "Bearer",
"expires_in": 1200,
"refresh_token": "46ToAxZETzA3RElpa1REaXdXYjNqaGNpTkln",
"authentication": {
"username": "foo",
"roles": [
"user"
],
"full_name": null,
"email": null,
"metadata": {},
"enabled": true,
"authentication_realm": {
"name": "native1",
"type": "native"
},
"lookup_realm": {
"name": "native1",
"type": "native"
}
}
} NOTE: The For SAML and OIDC authenticate calls, there will be some redundancy for
Here are a list of things we need to touch to implement above suggested changes:
|
That would work great for us, thanks for picking this up @ywangd ! |
Adding authentication object to following APIs: /_security/oauth2/token /_security/delegate_pki /_security/saml/authenticate /_security/oidc/authenticate Resolves: elastic#59685 (cherry picked from commit 51dbd9e)
* Adding authentication information to access token create APIs Adding authentication object to following APIs: /_security/oauth2/token /_security/delegate_pki /_security/saml/authenticate /_security/oidc/authenticate Resolves: #59685 (cherry picked from commit 51dbd9e) * Addressing PR commends, fixing tests * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Addressing PR comments * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Addressing more PR comments * Adding more to integration tests + some small fixes
…c#62490) * Adding authentication information to access token create APIs Adding authentication object to following APIs: /_security/oauth2/token /_security/delegate_pki /_security/saml/authenticate /_security/oidc/authenticate Resolves: elastic#59685 (cherry picked from commit 51dbd9e) * Addressing PR commends, fixing tests * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Addressing PR comments * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Addressing more PR comments * Adding more to integration tests + some small fixes
#63841) * Adding authentication information to access token create APIs (#62490) * Adding authentication information to access token create APIs Adding authentication object to following APIs: /_security/oauth2/token /_security/delegate_pki /_security/saml/authenticate /_security/oidc/authenticate Resolves: #59685 (cherry picked from commit 51dbd9e) * Addressing PR commends, fixing tests * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Addressing PR comments * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Returning tokenGroups attribute as SID string instead of byte array (AD metadata) Update version check * Addressing more PR comments * Adding more to integration tests + some small fixes * Nit fixes and formatting following #62490 comments (#63797) * Nit fixes and formatting following #62490 comments Resolves: #63792 * Nit fixes and formatting following #62490 comments Resolves: #63792 * Nit fixes and formatting following #62490 comments Fixing username * Nit fixes and formatting following #62490 comments Fixing formatting * Fixing merge conflicts * Fixing merge conflicts
Thanks for improving this @BigPandaToo ! Filed a Kibana issue to leverage this on our side: elastic/kibana#80952. |
Scratch that. After team discussion. We agree the current behaviour is more correct. |
…en refresh (#64031) * Fixing a problem with potential dirty read of a token document. Related to #59685 * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object Co-authored-by: Elastic Machine <[email protected]>
…en refresh (elastic#64031) * Fixing a problem with potential dirty read of a token document. Related to elastic#59685 * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object Co-authored-by: Elastic Machine <[email protected]>
…en refresh (#64031) (#64178) * Fixing a problem with potential dirty read of a token document on token refresh (#64031) * Fixing a problem with potential dirty read of a token document. Related to #59685 * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object * Fixing a problem with potential dirty read of a token document. Adding CreateTokenResult to hold authentication object Co-authored-by: Elastic Machine <[email protected]> * Fixing tests failures Co-authored-by: Elastic Machine <[email protected]>
Context: elastic/kibana#68117 (comment)
Currently every Elasticsearch API call that creates an access token made by Kibana is followed by the request to retrieve full user information (
GET /_security/_authenticate
):/_security/oauth2/token
(Kerberos and Token)/_security/delegate_pki
(PKI)/_security/saml/authenticate
(SAML)/_security/oidc/authenticate
(OIDC)Even though it's not technically required in some cases today we do this for the consistency sake. But soon we're going to implement features that would require this additional round-trip in all cases, e.g. to limit number of currently active sessions based on various criteria (username+realm or specific role name).
Currently
/_security/saml/authenticate
and/_security/oidc/authenticate
returnusername
, but based on the example above in the near future we may need to know user roles and whatnot.The question we have is, would it make sense to attach full user info right to the response of the operations that produce access tokens (or at least for some of them)?
@elastic/kibana-security
The text was updated successfully, but these errors were encountered: