-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Service Accounts - token name in response to Authenticate API #71382
Service Accounts - token name in response to Authenticate API #71382
Conversation
Pinging @elastic/es-security (Team:Security) |
The implication of this is that the Are we sure that's what we want? |
It's a good point. Given we explicitly said different tokens will not be different in terms of privileges, it is definitely non-ideal to have the potential DLS/FLS discrepency. Though I think it is unlikely for service accounts to have DLS/FLS, the theorectical possibility still makes the decision questionable. The other option that I have considered is to handle it in the place where the authenticate response is assembled ( |
I updated the PR to move the "token name in response" logic into the place where the authentication response is assembled, i.e. |
I think we actually want to put this as a first class concept in the response, not just bury it in the metadata. |
We can add a new top level field of Do you think it should be made more general, i.e. the new field will contain any metadata that the Authentication object has to offer. Or should it be more specific to |
I think you're reading it correctly - but it's just not as good an idea as it seemed when I wrote it. I'm not arguing for For #70306, I think we want to change the API response to be:
(And maybe do something about the realm as well). If we assume that we're going to go in that direction for API keys, then what it the appropriate change to make here? |
@tvernum I did some more thinking about this. I was initially in favor of a more generic
But a generic
I think overall I prefer your proposal because the confusion issue is not only confusing but also feels unprofessional. In terms of the actual field name, I slightly prefer |
Do you think we would populate that field if the request was authenticated with an OAuth access token? (or perhaps, in the future, a JWT?) |
Yes I consider this new field as an expansion to the |
The PR is updated to have the token name in a new top level {
"username": "elastic/fleet-server",
"roles": [],
"full_name": "Service account - elastic/fleet-server",
"email": null,
"token": {
"name": "token2"
},
"metadata": {
"_elastic_service_account": true
},
"enabled": true,
"authentication_realm": {
"name": "service_account",
"type": "service_account"
},
"lookup_realm": {
"name": "service_account",
"type": "service_account"
},
"authentication_type": "token"
} |
...rc/main/java/org/elasticsearch/xpack/core/security/authc/service/ServiceAccountSettings.java
Outdated
Show resolved
Hide resolved
…security/authc/service/ServiceAccountSettings.java Co-authored-by: Tim Vernum <[email protected]>
@elasticmachine update branch |
…c#71382) This PR adds the service account token name to a new top level field, "token", to the authenticate response. For now, this field will not show unless the authenticating credential is a service account. Co-authored-by: Tim Vernum <[email protected]>
#71808) This PR adds the service account token name to a new top level field, "token", to the authenticate response. For now, this field will not show unless the authenticating credential is a service account. Co-authored-by: Tim Vernum <[email protected]>
This PR adds the service account token name in a new top level field,
token
, to the authenticate response. For now, this new field is only shown when the authentication is for a service account.