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

Undefined access token #102

Open
mmorandini opened this issue Oct 28, 2021 · 3 comments
Open

Undefined access token #102

mmorandini opened this issue Oct 28, 2021 · 3 comments

Comments

@mmorandini
Copy link

When calling the getAuth() method in my integration (which has always worked until today), the headers object has Bearer undefined as value for the Authorization key.

As I said, the integration has always worked until today, which leaves me very confused.

@mmorandini
Copy link
Author

Also worth noting that no errors are thrown whatsoever. Everything seems to be working fine, except the access token comes back as undefined.

@koltyakov
Copy link
Contributor

Following an answer in Gitter:

mmorandini @mmorandini 14:37

Hello everyone, I have been experiencing a strange issue with the node-sp-auth package and I am hoping to get some help here hopefully.
The issue is that when calling the getAuth() with client_id and client_secret only, everything seems to be working ok (in that I don't get any errors back), but when the promise resolves, the access token comes back as undefined, so the "headers" object looks like this: {'Authorization': 'Bearer undefined'}.
Do you have any idea as to why this could be happening? Also worth mentioning that I have been observing this behavior only since yesterday, and that my integration was working fine before.

Andrew Koltyakov @koltyakov 14:53

Hi @mmorandini, did you prolongate the add in? By default an add-in registration is actual per a year, then needed secret update.
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/replace-an-expiring-client-secret-in-a-sharepoint-add-in

We may also add a fast fail check to the auth strategy for future, yet I have no outdated add-in to check at the moment.

@mmorandini
Copy link
Author

mmorandini commented Oct 29, 2021

Hi @koltyakov thanks for your help. I guess that would help should anyone have the same issue in future. Should I close the issue anyway?

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

2 participants