-
Notifications
You must be signed in to change notification settings - Fork 3
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
Expose Auth Token to API user for CLI Client #742
Comments
Additional Context:
|
@shreddd could you clarify if they would want to log in via an ORCiD, or with the username/password flow, or both? |
If you |
(waiting on use case confirmation/clarification) |
I think this is OK but seems like an extra step? The goal is to see if we can provide a token to the user for easy use. Poking at the code a bit I noticed that once logged into swagger we use a cookie to talk to the server - wondering if we could take advantage of this. Will follow up on Slack and post updates here.
|
We want this for both. Basically we always want to give the users an easy way to look at their token if they need it.
|
@shreddd Could you explain how you're thinking about programmatically accessing the cookie to access the token? One thing we could do is refactor the code below into its own endpoint, so that a user can POST their JWT and GET a bearer token. Is that what you had in mind? if user_id_token:
# get bearer token
rv = requests.post(
url=f"{BASE_URL_EXTERNAL}/token",
data={
"client_id": user_id_token,
"client_secret": "",
"grant_type": "client_credentials",
},
headers={
"Content-type": "application/x-www-form-urlencoded",
"Accept": "application/json",
},
)
if rv.status_code != 200:
rv.reason = rv.text
rv.raise_for_status()
access_token = rv.json()["access_token"] |
possibility: add bearer token info to |
From @shreddd in Slack
Related to #404
The text was updated successfully, but these errors were encountered: