Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The token audience is NOT valid #136

Open
tknaller opened this issue Oct 8, 2024 · 0 comments
Open

The token audience is NOT valid #136

tknaller opened this issue Oct 8, 2024 · 0 comments

Comments

@tknaller
Copy link

tknaller commented Oct 8, 2024

Hi,

I am connecting to an on premises SharePoint 2019 environment from NodeJS via @pnp/sp-commonjs@2.15.0 and also trying to connect using sp-request@^3.0.0 with OnPremiseAddinCredentials

The issue I am facing is that most of my data resides on Webapplication A (https://tools.contoso.com) and this is working perfectly. But I now need to pull some Data from Web Application B in the same SharePoint Farm (https://intranet.contoso.com) but I am getting a The token audience is NOT valid error because the audience is set to 00000003-0000-0ff1-ce00-000000000000/tools.contoso.com@addinRealmGUID

I am trying to set up sp-request with a fresh instance auf AuthConfig (getContext() then authOptions) as well as tried to run bootstrap(sp) again with the new authConfig and other URL, all leading to the same issue with the audience.

The App (ClientID) is the same for both Web Applications, it has permissions on both sites (wie appinv.aspx)

Please point me to what I am doing wrong or what more information you need to find out what's going wrong :)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant