question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missed state when create a new UserAgentApplication

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Browser:

  • Chrome version XX
  • Firefox version XX
  • IE version XX
  • Edge version XX
  • Safari version XX

Library version


Library version: 1.0.2



## Current behavior

In Configuration.ts we have the following lines to describe and define AuthOptions:

/**
 * @type AuthOptions: Use this to configure the auth options in the Configuration object
 *
 *  - clientId                    - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
 *  - authority                   - You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
 *  - validateAuthority           - Used to turn authority validation on/off. When set to true (default), MSAL will compare the application's authority against well-known URLs templates representing well-formed authorities. It is useful when the authority is obtained at run time to prevent MSAL from displaying authentication prompts from malicious pages.
 *  - redirectUri                 - The redirect URI of the application, this should be same as the value in the application registration portal.Defaults to `window.location.href`.
 *  - postLogoutRedirectUri       - Used to redirect the user to this location after logout. Defaults to `window.location.href`.
 *  - state                       - Use to send the state parameter with authentication request
 *  - navigateToLoginRequestUrl   - Used to turn off default navigation to start page after login. Default is true. This is used only for redirect flows.
 *
 */
export type AuthOptions = {
  clientId: string;
  authority?: string;
  validateAuthority?: boolean;
  redirectUri?: string | (() => string);
  postLogoutRedirectUri?: string | (() => string);
  navigateToLoginRequestUrl?: boolean;
};

## Expected behavior

As you can see in the comments below, is an state propertie, that is missing in the type AuthOptions


## Minimal reproduction of the problem with instructions



If is not included since new versions, how can I manage it, and pass state? I need it to control state after callback in SignIn or EditProfile policies

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yakimkocommented, Jun 21, 2019

@pkanher617 I got tslint error when try to pass state property, because its not defined in type

0reactions
sameeragcommented, Jun 24, 2019

@dluque92 as @pkanher617 mentioned above, AuthenticationParameters.ts class has the detail on how to send the ‘state’ per request. Closing this issue as #780 is in dev.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle errors and exceptions in MSAL.js - Microsoft Entra
This article gives an overview of the different types of errors and recommendations for handling common sign-in errors. MSAL error handling ...
Read more >
fable-compiler/Fable - Gitter
var userAgentApplication = new Msal.UserAgentApplication(applicationConfig. ... i restarted fable dotnet fable npm-start and also my backend server.
Read more >
msal | Yarn - Package Manager
MSAL for JavaScript enables client-side JavaScript web applications, running in a web browser, to authenticate users using Azure AD work and school accounts ......
Read more >
AzureAD/microsoft-authentication-library-for-js | Job 2
Data type to hold information about state returned from the server ... Constructor for the UserAgentApplication used to instantiate the UserAgentApplication ...
Read more >
Unable to create UserAgentApplication with Microsoft ...
As @fortunee indicated, UserAgentApplication is not for @azure/msal-node , you should use ConfidentialClientApplication or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found