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

Blank html returned by auth server due to "scope=" parameter from GenerateAuthUrl in OAuth2Service.cs #7

Open
myloxian opened this issue Aug 21, 2021 · 2 comments

Comments

@myloxian
Copy link

myloxian commented Aug 21, 2021

When I would run OAuth2Service.ConsoleApp, I would get a connection to the auth server, followed by a new window opening in my browser (chrome Version 92.0.4515.159 (Official Build) (64-bit)), but it would present a blank white window and the apiclient.config file would not get updated with an access token. Using the browser "inspect" would yield an empty html header and body. Removing "&scope=" from the url allowed it to work, so I checked the code and found a minor typo? If it matters, this was directed at sandbox-api.digkey.com.

Examining the code OAuth2Service.cs, I noticed that the documentation says that the "scopes" param is unused. Looking at line 57 I could see that it was using "scope=" instead of "scopes=". I changed it and all is working fine.

If I knew how to do it, I would provide a patch/push/pull request (I don't even know which one it is!).

@myloxian
Copy link
Author

myloxian commented Aug 21, 2021

I have generated a pull request #8 Hopefully I did that right. :)

@myloxian
Copy link
Author

myloxian commented Aug 21, 2021

Sigh. I closed the pull request until I find the proper solution.

For what it is worth, the issue is with the "scope=" parameter. Changing it to "scopes=" was not the fix, it just eliminated the problem by accident. There simply can't be a "scope=". If I remove it completely, changing the rest of the string format statement appropriately, the problem is eliminated. I can make a patch if you like, but since it means the "scope" parameter would be removed, it's not my call.

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