Hi <#C012RBW0F18|hydra>, I've been trying to setup...
# talk-hydra
l
Hi #hydra, I've been trying to setup a client and test OAuth2.0 flow out. Everything seems to work fine but I'm getting this error on callback url. I'm using passportjs.
Copy code
Failed to obtain access token:  {
  statusCode: 401,
  data: '{"error":"invalid_client","error_description":"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)."}'
}
Copy code
passport.use(
  new OAuth2Strategy(
    {
      authorizationURL: "https://{host}/oauth2/auth",
      tokenURL: "https://{host}/oauth2/token",
      clientID: HYDRA_CLIENT_ID,
      clientSecret: HYDRA_CLIENT_SECRET,
      callbackURL: "<https://127.0.0.1:8080/auth/hydra/callback>",
      state: true,
      scope: ["openid"]
    },
    function (accessToken, refreshToken, profile, done) {
      return done(null, { accessToken, profile });
    }
  )
);
I found out that passport-oauth2 supports only
client_secret_post
and so I changed in database
hydra_client
table
token_endpoint_auth_method
from
client_secret_basic
to
client_secret_post
Am I missing something or did anything wrong?
nvm, I missed something. had been using secret of some other client that I created over the time.