hongming /kubesphere $ curl -X POST ‘http://ks-apiserver.kubesphere-system.svc/oauth/token’ -H ‘Content-Type: application/x-www-form-urlencoded’ –data-ur
lencode ‘grant_type=password’ –data-urlencode ‘username=admin’ –data-urlencode ‘password=P@88w0rd’
{
“access_token”: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwidWlkIjoiYzI5ZTVmMDYtYWUzYi00MzliLWFhZTEtZWMxY2MxODgxOTA1IiwidG9rZW5fdHlwZSI6ImFjY2Vzc190b2tlbiIsImV4cCI6MTYwNTkzOTMzNSwiaWF0IjoxNjA1OTMyMTM1LCJpc3MiOiJrdWJlc3BoZXJlIiwibmJmIjoxNjA1OTMyMTM1fQ.YkogOmub9q0Hh7PcZpBHPE7t_lhAorhDfWx8Q1LLjbk”,
“token_type”: “Bearer”,
“refresh_token”: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwidWlkIjoiYzI5ZTVmMDYtYWUzYi00MzliLWFhZTEtZWMxY2MxODgxOTA1IiwidG9rZW5fdHlwZSI6InJlZnJlc2hfdG9rZW4iLCJleHAiOjE2MDU5NDY1MzUsImlhdCI6MTYwNTkzMjEzNSwiaXNzIjoia3ViZXNwaGVyZSIsIm5iZiI6MTYwNTkzMjEzNX0.UGJXPtqXmxOTH19fkG47kaGuz0ZHwSTpJ6En3o-rGQI”,
“expires_in”: 7200
}/kubesphere $
root@master01 console-release-3.0]# kubectl get users admin -o yaml
apiVersion: iam.kubesphere.io/v1alpha2
kind: User
metadata:
annotations:
iam.kubesphere.io/password-encrypted: “true”
creationTimestamp: “2020-11-19T06:45:02Z”
finalizers:
- finalizers.kubesphere.io/users
generation: 40
managedFields:
- apiVersion: iam.kubesphere.io/v1alpha2
fieldsType: FieldsV1
fieldsV1:
f:spec:
.: {}
f:email: {}
manager: kubectl
operation: Update
time: “2020-11-21T03:38:39Z”
- apiVersion: iam.kubesphere.io/v1alpha2
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:iam.kubesphere.io/password-encrypted: {}
f:finalizers:
.: {}
v:“finalizers.kubesphere.io/users”: {}
f:spec:
f:password: {}
f:status:
.: {}
f:lastLoginTime: {}
f:lastTransitionTime: {}
f:state: {}
manager: controller-manager
operation: Update
time: “2020-11-21T04:15:45Z”
name: admin
resourceVersion: “2543458”
selfLink: /apis/iam.kubesphere.io/v1alpha2/users/admin
uid: c29e5f06-ae3b-439b-aae1-ec1cc1881905
spec:
email: admin@kubesphere.io
password: $2a$10$CB6dCIDT.2rogiPWYxONs.6fykHx3TtOnqUhCPSR7MiwOoP36AaoO
status:
lastLoginTime: “2020-11-21T04:15:45Z”
lastTransitionTime: “2020-11-21T03:38:39Z”
state: Active