-
Notifications
You must be signed in to change notification settings - Fork 83
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
CLI user authentication #448
Comments
@duttarnab Can you summarize steps to be performed? |
We need 2 OIDC clients for this
Steps:
|
I think you can use one client. If OAuth is required for security: grant_type = client credential grant; otherwise grant_type = password. However, you may want to create one client for "read" access and one client for "write" access, i.e. with different scopes. For OAuth, the client should have long lived access tokens (client specific setting), 30 days default (?). BTW, I like how Github is handling CLI operations. They offload authn to the Web Browser, and then hand you an access token for your CLI application. This should be the model. |
I checked and found that github is using device flow to achieve this.. And we have already implemented device flow in Gluu auth server. So here are the steps:
Then it can use access token for furthur processing like getting |
This makes sense to me |
We should require authentication to use the CLI. Having shell access is not enough.
In the Admin UI, we have a mapping of roles to scopes. The CLI should have the same behavior. The good news is that the scopes are populated by an Introspection Interception Script. So as long as the CLI authenticates the user and obtains an access token, the scopes will be present.
There should be two ways to authenticate the user:
To pass the username, you can use a argument like
-u
or--username
.To pass the password, I suggest two options:
-p
or--password
, or-j
--passwordFile
, where the admin can store the password. The advantage of-j
is that the password would not show in the history (and hopefully the admin would remove the password after running the command).With the username and password, the CLI can make an HTTPS call to the
/token
endpoint of the Authorization Server responsible for issuing access tokens to authorize calling the config-api, using the ROPW grant. How the user might obtain a refresh token is out of scope (there would have to be some admin client application that provided this).Note some applications may not allow the ROPW grant type. If this is the case, the admin could also present the
-t
or--tokenFile
argument. This would reference a file with a long lived access token. Nice to have would be call to secets vault.In interactive mode, if the user does not provide credentials via the command line, the system should ask for username and password. Note, this would be limited to ROPW flow.
The text was updated successfully, but these errors were encountered: