@azure/msal-react package

Arabirimler

IMsalContext

İşlevler

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

Kullanıcının kimliği doğrulanmışsa alt bileşenleri işler

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 }>)

Henüz kimliği doğrulanmamışsa kullanıcının kimliğini doğrulamayı dener, ardından alt bileşenleri işler

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL bağlam sağlayıcısı bileşeni. Bu, MSAL kullanan diğer bileşenlerin üzerinde işlenmelidir.

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

Kullanıcı kimliği doğrulanmamışsa alt bileşenleri işler

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

1 veya daha fazla accountIdentifiers verildiğinde, kullanıcı oturum açmışsa Account nesnesini döndürür

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

Kullanıcının şu anda oturum açıp açmadığını döndürür. İsteğe bağlı olarak, belirli bir kullanıcının oturum açıp açmadığını belirlemek için 1 veya daha fazla accountIdentifiers sağlayın

useMsal()

Msal Bağlam değerlerini döndürür

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

Bir kullanıcı şu anda bu kancada oturum açmadıysa bir oturum açma çağırır. Başarısız oturum açma işlemleri, döndürülen oturum açma geri çağrısı kullanılarak yeniden denenebilir. Bir kullanıcı şu anda bu kancada oturum açmışsa bir belirteç almayı dener. Sonraki belirteç istekleri döndürülen acquireToken geri çağırmasını kullanabilir. İsteğe bağlı olarak login/acquireToken çağrısında kullanılacak bir istek nesnesi sağlayın. İsteğe bağlı olarak oturum açması gereken belirli bir kullanıcı sağlayın.

withMsal<P>(ComponentType<P>)

Daha yüksek sıralı bileşen, msal bağlam değerlerini bileşenin props içine ekleyerek sağlanan bileşeni msal ile sarmalar

İşlev Ayrıntıları

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

Kullanıcının kimliği doğrulanmışsa alt bileşenleri işler

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

Parametreler

props

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

Döndürülenler

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 }>)

Henüz kimliği doğrulanmamışsa kullanıcının kimliğini doğrulamayı dener, ardından alt bileşenleri işler

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

Parametreler

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 }>

Döndürülenler

React.ReactElement | null

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL bağlam sağlayıcısı bileşeni. Bu, MSAL kullanan diğer bileşenlerin üzerinde işlenmelidir.

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

Parametreler

__namedParameters

PropsWithChildren<{ instance: IPublicClientApplication }>

Döndürülenler

React.ReactElement

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

Kullanıcı kimliği doğrulanmamışsa alt bileşenleri işler

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

Parametreler

props

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

Döndürülenler

React.ReactElement | null

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

1 veya daha fazla accountIdentifiers verildiğinde, kullanıcı oturum açmışsa Account nesnesini döndürür

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

Parametreler

accountIdentifiers

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

Döndürülenler

AccountInfo | null

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

Kullanıcının şu anda oturum açıp açmadığını döndürür. İsteğe bağlı olarak, belirli bir kullanıcının oturum açıp açmadığını belirlemek için 1 veya daha fazla accountIdentifiers sağlayın

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

Parametreler

matchAccount

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

Döndürülenler

boolean

useMsal()

Msal Bağlam değerlerini döndürür

function useMsal(): IMsalContext

Döndürülenler

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

Bir kullanıcı şu anda bu kancada oturum açmadıysa bir oturum açma çağırır. Başarısız oturum açma işlemleri, döndürülen oturum açma geri çağrısı kullanılarak yeniden denenebilir. Bir kullanıcı şu anda bu kancada oturum açmışsa bir belirteç almayı dener. Sonraki belirteç istekleri döndürülen acquireToken geri çağırmasını kullanabilir. İsteğe bağlı olarak login/acquireToken çağrısında kullanılacak bir istek nesnesi sağlayın. İsteğe bağlı olarak oturum açması gereken belirli bir kullanıcı sağlayın.

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

Parametreler

interactionType
InteractionType
authenticationRequest

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

accountIdentifiers

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

Döndürülenler

withMsal<P>(ComponentType<P>)

Daha yüksek sıralı bileşen, msal bağlam değerlerini bileşenin props içine ekleyerek sağlanan bileşeni msal ile sarmalar

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

Parametreler

Component

ComponentType<P>

Döndürülenler

FunctionComponent<Subtract<P, WithMsalProps>>

Değişken Ayrıntıları

MsalConsumer

MsalConsumer: React.Consumer<IMsalContext>

Tür

React.Consumer<IMsalContext>

MsalContext

MsalContext: React.Context<IMsalContext>

Tür

React.Context<IMsalContext>

version

version: "3.0.29"

Tür

"3.0.29"