@azure/msal-react package

Interfaces

IMsalContext

Functies

AuthenticatedTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>)

Onderliggende onderdelen weergeven als de gebruiker is geverifieerd

MsalAuthenticationTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">> & { authenticationRequest?: PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, errorComponent?: any, interactionType: InteractionType, loadingComponent?: any }>)

Probeert de gebruiker te verifiëren als deze nog niet is geverifieerd en geeft vervolgens onderliggende onderdelen weer

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL-contextprovideronderdeel. Dit moet worden weergegeven boven alle andere onderdelen die GEBRUIKMAKEN van MSAL.

UnauthenticatedTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>)

Onderliggende onderdelen weergeven als de gebruiker niet is geverifieerd

useAccount(Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Met 1 of meer accountIdentifiers wordt het accountobject geretourneerd als de gebruiker is aangemeld

useIsAuthenticated(Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Hiermee wordt geretourneerd of een gebruiker momenteel is aangemeld. Geef desgewenst 1 of meer accountIdentifiers op om te bepalen of een specifieke gebruiker is aangemeld

useMsal()

Geeft als resultaat Msal Context-waarden

useMsalAuthentication(InteractionType, PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Als een gebruiker momenteel niet is aangemeld, roept deze hook een aanmelding aan. Mislukte aanmeldingen kunnen opnieuw worden geprobeerd met behulp van de terugbelaanroep van de aanmelding. Als een gebruiker momenteel is aangemeld bij deze hook, wordt geprobeerd een token te verkrijgen. Volgende tokenaanvragen kunnen gebruikmaken van de acquireToken-callback die wordt geretourneerd. Geef eventueel een aanvraagobject op dat moet worden gebruikt in de aanroep login/acquireToken. Geef desgewenst een specifieke gebruiker op die moet worden aangemeld.

withMsal<P>(ComponentType<P>)

Onderdeel met een hogere volgorde verpakt het opgegeven onderdeel met msal door msal-contextwaarden in de props van het onderdeel te injecteren

Functiedetails

AuthenticatedTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>)

Onderliggende onderdelen weergeven als de gebruiker is geverifieerd

function AuthenticatedTemplate(props: PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>): React.ReactElement | null

Parameters

props

PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>

Retouren

React.ReactElement | null

MsalAuthenticationTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">> & { authenticationRequest?: PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, errorComponent?: any, interactionType: InteractionType, loadingComponent?: any }>)

Probeert de gebruiker te verifiëren als deze nog niet is geverifieerd en geeft vervolgens onderliggende onderdelen weer

function MsalAuthenticationTemplate(props: PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">> & { authenticationRequest?: PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, errorComponent?: any, interactionType: InteractionType, loadingComponent?: any }>): React.ReactElement | null

Parameters

props

PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">> & { authenticationRequest?: PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, errorComponent?: any, interactionType: InteractionType, loadingComponent?: any }>

Retouren

React.ReactElement | null

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL-contextprovideronderdeel. Dit moet worden weergegeven boven alle andere onderdelen die GEBRUIKMAKEN van MSAL.

function MsalProvider(__namedParameters: PropsWithChildren<{ instance: IPublicClientApplication }>): React.ReactElement

Parameters

__namedParameters

PropsWithChildren<{ instance: IPublicClientApplication }>

Retouren

React.ReactElement

UnauthenticatedTemplate(PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>)

Onderliggende onderdelen weergeven als de gebruiker niet is geverifieerd

function UnauthenticatedTemplate(props: PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>): React.ReactElement | null

Parameters

props

PropsWithChildren<Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>>

Retouren

React.ReactElement | null

useAccount(Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Met 1 of meer accountIdentifiers wordt het accountobject geretourneerd als de gebruiker is aangemeld

function useAccount(accountIdentifiers?: Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>): AccountInfo | null

Parameters

accountIdentifiers

Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>

Retouren

AccountInfo | null

useIsAuthenticated(Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Hiermee wordt geretourneerd of een gebruiker momenteel is aangemeld. Geef desgewenst 1 of meer accountIdentifiers op om te bepalen of een specifieke gebruiker is aangemeld

function useIsAuthenticated(matchAccount?: Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>): boolean

Parameters

matchAccount

Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>

Retouren

boolean

useMsal()

Geeft als resultaat Msal Context-waarden

function useMsal(): IMsalContext

Retouren

useMsalAuthentication(InteractionType, PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>)

Als een gebruiker momenteel niet is aangemeld, roept deze hook een aanmelding aan. Mislukte aanmeldingen kunnen opnieuw worden geprobeerd met behulp van de terugbelaanroep van de aanmelding. Als een gebruiker momenteel is aangemeld bij deze hook, wordt geprobeerd een token te verkrijgen. Volgende tokenaanvragen kunnen gebruikmaken van de acquireToken-callback die wordt geretourneerd. Geef eventueel een aanvraagobject op dat moet worden gebruikt in de aanroep login/acquireToken. Geef desgewenst een specifieke gebruiker op die moet worden aangemeld.

function useMsalAuthentication(interactionType: InteractionType, authenticationRequest?: PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, accountIdentifiers?: Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>): MsalAuthenticationResult

Parameters

interactionType
InteractionType
authenticationRequest

PopupRequest | RedirectRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "earJwk" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>

accountIdentifiers

Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>

Retouren

withMsal<P>(ComponentType<P>)

Onderdeel met een hogere volgorde verpakt het opgegeven onderdeel met msal door msal-contextwaarden in de props van het onderdeel te injecteren

function withMsal<P>(Component: ComponentType<P>): FunctionComponent<Subtract<P, WithMsalProps>>

Parameters

Component

ComponentType<P>

Retouren

FunctionComponent<Subtract<P, WithMsalProps>>

Variabele details

MsalConsumer

MsalConsumer: React.Consumer<IMsalContext>

Type

React.Consumer<IMsalContext>

MsalContext

MsalContext: React.Context<IMsalContext>

Type

React.Context<IMsalContext>

version

version: "3.0.29"

Type

"3.0.29"