Replies: 5 comments 2 replies
-
Hello, Any news about this? |
Beta Was this translation helpful? Give feedback.
-
I'm sorry for the delayed response. It is indeed a good question. We didn't implement this yet because we had personal usage of oidc-agent in mind. The flow is rather simple and could also be handled by a simple script, so I'm a bit unsure about the benefit to have this in the agent. What do you think, would it be beneficial to have this in the agent instead of a simple script? |
Beta Was this translation helpful? Give feedback.
-
Hallo Gabriel, |
Beta Was this translation helpful? Give feedback.
-
Indeed, I was mainly thinking about this.
In my humble opinion, a simple script should be enough. To be honest, I created this discussion for the following reason: we are using the
Option1 or 2 seem to be easier to set up than option3.
I guess the following script could work, what do you think @zachmann @maarten-litmaath? #!/bin/bash
# ---------------------------------------------------
# inputs
# ---------------------------------------------------
# Issuer URL
# Could be passed in parameter as $1
ISSUER_URL="https://example.com/"
# Token Endpoint
# Could be extracted from the .well-known path or passed in parameter as $2 (or as part of ISSUER_URL in $1)
# Should be present in $ISSUER_URL/.well-known/openid-configuration
TOKEN_ENDPOINT="${ISSUER_URL}/oauth2/token"
# Client credentials
# Could be extracted from a secret management service (e.g. teigi)
CLIENT_ID="your_client_id"
CLIENT_SECRET="your_client_secret"
# ---------------------------------------------------
# get a client access token
# ---------------------------------------------------
# Request an access token
response=$(curl -s \
-u ${CLIENT_ID}:${CLIENT_SECRET} \
-d "grant_type=client_credentials" \
${TOKEN_ENDPOINT})
# Extract the access token from the response
access_token=$(echo $response | jq -r '.access_token')
# ---------------------------------------------------
# use the client access token
# ---------------------------------------------------
... |
Beta Was this translation helpful? Give feedback.
-
We can add this to the agent; so it's not a problem of implementation complexity. My main concern is if it makes sense. But it there is interest, we can support this. I see two options how this then could be used with the agent:
Approach 2 would create an encrypted account configuration. Encryption is a plus, but might bring problems in machine2machine usability.
Of course using an encryption mechanism that can be done non-interactively will only give limited encryption benefits. |
Beta Was this translation helpful? Give feedback.
-
Hello,
IIUC, the
oidc-gen
command generates an OAuth2 client and starts anauthorization_code
(orpassword
, ordevice_code
) flow requiring user interaction.Once done, the refresh token is securely stored and can be used by the
oidc-token
command (refresh_token
flow).This workflow is fine for scenarios requiring user interaction, but what about machine-to-machine communications?
Are you planning to integrate the
client_credentials
flow inoidc-agent
?Or do you think this use case should be manually handled since there is no need to store a refresh token?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions