Bug 1488910 - User cannot get his own user UID
Summary: User cannot get his own user UID
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: apiserver-auth
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Simo Sorce
QA Contact: Chuan Yu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-06 12:57 UTC by Tomas Plevko
Modified: 2019-03-29 15:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-11 17:10:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomas Plevko 2017-09-06 12:57:31 UTC
Description of problem:

I found that the OS user is not able to get his own UID. The user needs cluster-admin rights to get UID's of all users. He should be able to look up his own UID.


For instance github user can access his ID easilly:
https://api.github.com/users/tplevko


Version-Release number of selected component (if applicable):
3.x


Steps to Reproduce:
1. oc get user test --> User "test" cannot list all users in the cluster
2. https://{url}/oapi/v1/users --> the same result

Comment 1 Mo 2017-09-08 15:28:49 UTC
The current user is aliased as ~



$ oc whoami
developer



$ oc get users '~'
NAME        UID                                    FULL NAME   IDENTITIES
developer   578e2223-93e9-11e7-b947-507b9dac97ff               anypassword:developer



$ oc get users '~' -o yaml
apiVersion: v1
groups: []
identities:
- anypassword:developer
kind: User
metadata:
  creationTimestamp: 2017-09-07T16:26:46Z
  name: developer
  resourceVersion: "836"
  selfLink: /oapi/v1/users/developer
  uid: 578e2223-93e9-11e7-b947-507b9dac97ff



@Tomas please close if this works for you.

Comment 2 Tomas Plevko 2017-09-11 17:10:19 UTC
@Mo, it works! Thank you for the help, I couldn't find it anywhere. I think this could be a good input into the knowledge base.


Note You need to log in before you can comment on or make changes to this bug.