Skip to content

Cannot set audience claim using NextAuth/Auth.js #3998

@pavelbelyaev98

Description

@pavelbelyaev98

Preflight checklist

Ory Network Project

No response

Describe the bug

I am using NextAuth/Auth.js.

It is correctly sending the audience claim to ory hydra in the url, however hydra fails to set the audience claim in the access token.

I am using jwt strategy with oAuth2.0 client

Reproducing the bug

https://www.ory.sh/docs/getting-started/integrate-auth/auth-js

Install the example app and configure it to have an audience + jwt strategy both in ory hydra oAuth 2.0 and in the nextjs app.

Try to sign in, the sign in will work as expected, but the access token will lack the audience claim.

Relevant log output

Relevant configuration

Version

2.3.0

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions