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

Track MSAL SKU for broker flows #7182

Merged
merged 12 commits into from
Jul 17, 2024
Merged

Track MSAL SKU for broker flows #7182

merged 12 commits into from
Jul 17, 2024

Conversation

konstantin-msft
Copy link
Collaborator

  • Track MSAL SKU for broker flows
  • Enable server telemetry platform fields propagation
  • Propagate broker error to server telemetry

@github-actions github-actions bot added msal-browser Related to msal-browser package msal-common Related to msal-common package documentation Related to documentation. labels Jun 28, 2024
* @private
*/
private addRequestSKUs(request: NativeTokenRequest) {
request.extraParameters = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we should not modify input params. You should return a value instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one modifies validatedRequest which is an extended copy of request. I do not think we need to add another spread operator here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We fixed a bug related to this pattern last week and I have a work item open to resolve remaining instances & turn on linting to catch in the future. We can discuss offline if you like.


const BrokerServerParamKeys = {
BROKER_CLIENT_ID: "brk_client_id",
BROKER_REDIRECT_URI: "brk_redirect_uri",
};

/**
* Provides MSAL and browser extension SKUs
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explicitly document what you expect to have in skus[0..4].

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need to document it here in the code given that we have a shared spec?

@@ -307,8 +365,13 @@ export class NativeInteractionClient extends BaseInteractionClient {
this.validateNativeResponse(response);
} catch (e) {
// Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if we document that if an error here happens, the application needs to retry? It feels like something we should handle for them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We fall back to the web flow if the native flow throws. cc @tnorling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-browser Related to msal-browser package msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants