Skip to content

The token audience is NOT valid #136

@tknaller

Description

@tknaller

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions