Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1488910

Summary: User cannot get his own user UID
Product: OpenShift Container Platform Reporter: Tomas Plevko <tplevko>
Component: apiserver-authAssignee: Simo Sorce <ssorce>
Status: CLOSED NOTABUG QA Contact: Chuan Yu <chuyu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aos-bugs, mkhan, tplevko
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-11 17:10:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.