Hi Folks, can i perform client_credentials flow th...
# talk-hydra
a
Hi Folks, can i perform client_credentials flow through the admin api instead of cli as shown below, i need to get a token without going through the login and consent flow if possible.
Copy code
Sort of like running $> hydra token client on cli as in
hydra hydra token client --endpoint <http://localhost:4444/> --client-id my-client --client-secret my-secret
c
if you have hydra running as a container, you can register a client once through the cli and then use an SDK or HTTP request to ask the public endpoint for a token. For the client-credentials flow, you don't have to login and consent. You only need to provide the client id and secret when asking for the token.
a
thats great although i am after the api path i need to hit over http building my own rest client
c
Use this as your guide: https://www.ory.sh/docs/reference/api#tag/public/operation/oauth2Token If you have setup your client for http_basic authentication, make sure to include the credentials in the HTTP Basic authentication header. For the body you only need to specify grant_type=client_credentials
a
great thanks
also is there a way to embed some metadata in the token (currently using jwt access token strategy)
as you do with acceptLogin in oauth2 flow
c
I believe this is not supported by the client credentials flow.
a
ok ta