i'm trying to get access_token and refresh_token u...
# talk-hydra
f
i'm trying to get access_token and refresh_token using /oauth2/token endpoint and @ory/hydra-client sdk but getting this error & the docs says that this endpoint is not implemented properly, so i was wondering, i'm getting this error because of some problems in the endpoint itself or i'm doing something wrong here?.
here's the payload that i'm passing
g
I have also got the same error. There was miss-configuration while creating client. Can please cross check client you have created.
f
so it worked for you with hydra sdk after correcting the config @gifted-salesmen-20057?
g
Yes it worked for me
f
okay, lemme check my config then.
Thanks for the help!
here's my client confg
Copy code
{
id: "hydra_client_07d9021a64",
client_name: "Test App",
client_secret: "some secret",
redirect_uris: "<http://localhost:3000/auth/callback/hydra>",
grant_types: "authorization_code|refresh_token|client_credentials|implicit",
response_types: "code|id_token|token",
scope: "openid|offline|email|profile|phone|address",
jwks_uri:"<http://localhost:4444/.well-known/jwks.json>",
token_endpoint_auth_method : "client_secret_basic",
userinfo_signed_response_alg: "none",
subject_type:"none",
registration_access_token_signature: "some signature code",
token_endpoint_auth_signing_alg: ""
}
@gifted-salesmen-20057
g
in request are you using providing
client_secret
?
f
no
g
you have to provide
client_secret
in request thats why you are getting error.
f
there's no client_secret parameter in oauth2Token method of the SDK
g
Please check this. The note says hydra sdk does not implement this endpoint properly.
f
Okay, i tried calling endpoint with fetch instead of SDK and i also passed client_secret but now i'm getting different error.
i'll change client config and try again.
i changed the token_endpoint_auth_method from client_secret_basic to client_secret_post and now it's working, Thanks @gifted-salesmen-20057!!
g
Nice 🎉