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

Update documentation with browser code #87

Open
OliverPA77 opened this issue Nov 1, 2020 · 0 comments
Open

Update documentation with browser code #87

OliverPA77 opened this issue Nov 1, 2020 · 0 comments

Comments

@OliverPA77
Copy link

Hi,
having read a lot of the questions here and on the web around SSPI it seems there are a few common misconceptions that are easily solved.

In the end 3 lines of code solved things for me - could you please add this info to your sample code?

Browser code to use SSPI:

  1. you need to add credentials:include to the fetch request:
    fetch(https://yourserver/auth, { method: 'GET', credentials:'include'})
  2. your server needs to return the proper CORS headers:
    Access-Control-Allow-Origin must be returned and cannot be * but must match the origin header of the incoming request
    Access-Control-Allow-Credentials must be 'true'

That's it - couldn't be easier. Took a few hours though...
Thanks!

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