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

[Identity] Using service-bus for manual test with MSAL 2.0 #13308

Merged
merged 10 commits into from
Feb 13, 2021

Conversation

sadasant
Copy link
Contributor

@sadasant sadasant commented Jan 20, 2021

Updates the Identity InteractiveBrowserCredential to work with MSAL 1 and 2, meaning with the Implicit Grant flow and the Auth Code Flow. Also moved it from using Key Vault to use Service Bus, since Key Vault doesn't allow CORS.

Relies on this update: #13263

Fixes #13307

Once finished and cleaned up, fixes #13307
@sadasant sadasant self-assigned this Jan 20, 2021
@ghost ghost added the Azure.Identity label Jan 20, 2021
@sadasant sadasant changed the title [Identity] Using service-bus for MSAL 2.0 [Identity] Using service-bus for manual test with MSAL 2.0 Jan 21, 2021
Copy link
Contributor

@sophiajt sophiajt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me, but can you also get one of the service bus folks to look at it?

@sadasant
Copy link
Contributor Author

sadasant commented Feb 3, 2021

@jonathandturner I'll get @HarshaNalluru 🌞

@sadasant sadasant changed the title [Identity] Using service-bus for manual test with MSAL 2.0 [DO NOT MERGE] [Identity] Using service-bus for manual test with MSAL 2.0 Feb 3, 2021
@sadasant sadasant changed the title [DO NOT MERGE] [Identity] Using service-bus for manual test with MSAL 2.0 [Identity] Using service-bus for manual test with MSAL 2.0 Feb 11, 2021
@@ -2,7 +2,7 @@

This package contains some simple manual verification for the use of Azure
Identity with other Azure SDK libraries in the browser. For now, it just tests
that the `InteractiveBrowserCredential` works with the `@azure/keyvault-keys`
that the `InteractiveBrowserCredential` works with the `@azure/service-bus`
Copy link
Member

@HarshaNalluru HarshaNalluru Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this..

Access to fetch at 'https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Why don't I run into the same error when I'm bundling and serving with "parcel"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, running with a new AAD application worked fine.
Might be that the older AAD apps are not supported the same way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should work too 👍 the app that I have (the one you saw me run this through) is an older one. Can you try again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It failed again, it is not a blocker of this PR. Based on our discussion offline, we don't know what's causing it.
Let's investigate further once the MSAL people get back to you on the issue.

- Creating a Key Vault (if you haven't created one).
- Either in the "Access policies" section of the creation form, or by going to your Key Vault's "Access policies" page, click con `+ Add Access Policy`, select all permissions, then select your AAD application as the "principal", then click "Add", then click "Save" if applicable.
- Creating a Service Bus namespace (if you haven't created one).
- Either in the "Access policies" section of the creation form, or by going to the Service Bus namespace's "Access policies" page, click con `+ Add Access Policy`, select all permissions, then select your AAD application as the "Service Bus Data Owner", then click "Add", then click "Save" if applicable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked.. you can't add access policies while creation.. you need to go to the namespace and do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Harsha!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Either in the "Access policies" section of the creation form, or by going to the Service Bus namespace's "Access policies" page, click con `+ Add Access Policy`, select all permissions, then select your AAD application as the "Service Bus Data Owner", then click "Add", then click "Save" if applicable.
- Go to the Service Bus namespace's "Access control (IAM)" tab, click on `+ Add` > `Add role assignment`, Pick "Service Bus Data Owner" role, and select your AAD application to assign the role, then click "Save".

@sadasant sadasant merged commit adf6765 into master Feb 13, 2021
@sadasant sadasant deleted the 13307-IBC-service-bus branch February 13, 2021 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Identity] Update the InteractiveBrowserCredential manual test
3 participants