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

Add devlogin to simulate production EasyAuth #81

merged 1 commit into from Jul 29, 2020

Add devlogin to simulate production EasyAuth #81

merged 1 commit into from Jul 29, 2020


Copy link

@c-w c-w commented Jul 29, 2020

In production we don't need to pass any authorization headers since the Easy Auth redirect sets up the appropriate cookies for us. During local development, we can emulate the same authentication by grabbing an ID Token from Active Directory and passing it as the Authorization header. This pull request implements a flow to make it super easy to grab the ID token: simply head to http://localhost:3000/devlogin, click the link which will redirect to B2C. Once the login is complete, B2C will redirect back to localhost which will in turn stash the ID Token in local storage so that requests can then access it. Any API request should use the new util/request method which automatically passes through the Authorization header if the developer went through this login flow.

@c-w c-w requested a review from jeongl Jul 29, 2020
@c-w c-w merged commit e6e0f68 into master Jul 29, 2020
3 checks passed
@c-w c-w deleted the devlogin branch Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant