@@ -12,6 +12,10 @@ Creates a bearer token for access without requiring basic authentication.
12
12
13
13
`POST /_security/oauth2/token`
14
14
15
+ [[security-api-get-token-prereqs]]
16
+ ==== {api-prereq-title}
17
+
18
+ * To use this API, you must have the `manage_token` cluster privilege.
15
19
16
20
[[security-api-get-token-desc]]
17
21
==== {api-description-title}
@@ -45,33 +49,56 @@ The following parameters can be specified in the body of a POST request and
45
49
pertain to creating a token:
46
50
47
51
`grant_type`::
48
- (string) The type of grant. Supported grant types are: `password`, `_kerberos`,
49
- `client_credentials` and `refresh_token`. The `_kerberos` grant type
50
- is supported internally and implements SPNEGO based Kerberos support. The `_kerberos`
51
- grant type may change from version to version.
52
+ (Required, string) The type of grant.
53
+ Supported grant types are: `password`, `_kerberos`,
54
+ `client_credentials` and `refresh_token`.
55
+
56
+ `client_credentials`:::
57
+ This grant type implements the Client Credentials Grant of OAuth2. It is geared
58
+ for machine to machine communication and is not suitable or designed for the
59
+ self-service user creation of tokens. It generates only access tokens that
60
+ cannot be refreshed. The premise is that the entity that uses
61
+ `client_credentials` has constant access to a set of (client, not end-user)
62
+ credentials and can authenticate itself at will.
63
+
64
+ `_kerberos`:::
65
+ This grant type is supported internally and implements SPNEGO based Kerberos
66
+ support. The `_kerberos` grant type may change from version to version.
67
+
68
+ `password`:::
69
+ This grant type implements the Resource Owner Password Credentials Grant of
70
+ OAuth2. In this grant, a trusted client exchanges the end user's credentials
71
+ for an access token and (possibly) a refresh token. The request needs to be made
72
+ by an authenticated user but happens _on behalf_ of another authenticated user
73
+ (the one whose credentials are passed as request parameters). This grant type is
74
+ not suitable or designed for the self-service user creation of tokens.
75
+
76
+ `refresh_token`:::
77
+ This grant type implements the Refresh Token Grant of OAuth2.
78
+ In this grant a user exchanges a previously issued refresh token for a new access token and a new refresh token.
52
79
53
80
`password`::
54
- (string) The user's password. If you specify the `password` grant type, this
81
+ (Optional^*^, string) The user's password. If you specify the `password` grant type, this
55
82
parameter is required. This parameter is not valid with any other supported
56
83
grant type.
57
84
58
85
`kerberos_ticket`::
59
- (string) base64 encoded kerberos ticket. If you specify the `_kerberos` grant type,
60
- this parameter is required. This parameter is not valid with any other supported
61
- grant type.
86
+ (Optional^*^, string) The base64 encoded kerberos ticket. If you specify the
87
+ `_kerberos` grant type, this parameter is required. This parameter is not valid
88
+ with any other supported grant type.
62
89
63
90
`refresh_token`::
64
- (string) If you specify the `refresh_token` grant type, this parameter is
65
- required. It contains the string that was returned when you created the token
66
- and enables you to extend its life . This parameter is not valid with any other
91
+ (Optional^*^, string) The string that was returned when you created the token,
92
+ which enables you to extend its life. If you specify the `refresh_token` grant
93
+ type, this parameter is required . This parameter is not valid with any other
67
94
supported grant type.
68
95
69
96
`scope`::
70
- (string) The scope of the token. Currently tokens are only issued for a scope of
97
+ (Optional, string) The scope of the token. Currently tokens are only issued for a scope of
71
98
`FULL` regardless of the value sent with the request.
72
99
73
100
`username`::
74
- (string) The username that identifies the user. If you specify the `password`
101
+ (Optional^*^, string) The username that identifies the user. If you specify the `password`
75
102
grant type, this parameter is required. This parameter is not valid with any
76
103
other supported grant type.
77
104
0 commit comments