@azure/msal-react package
Arabirimler
| IMsalContext |
Tür Diğer Adları
| AccountIdentifiers | |
| AuthenticatedTemplateProps | |
| MsalAuthenticationProps | |
| MsalAuthenticationResult | |
| MsalProviderProps | |
| SetComplement | |
| SetDifference | |
| Subtract | |
| UnauthenticatedTemplateProps | |
| WithMsalProps |
İşlevler
| Authenticated |
Kullanıcının kimliği doğrulanmışsa alt bileşenleri işler |
| Msal |
Henüz kimliği doğrulanmamışsa kullanıcının kimliğini doğrulamayı dener, ardından alt bileşenleri işler |
| Msal |
MSAL bağlam sağlayıcısı bileşeni. Bu, MSAL kullanan diğer bileşenlerin üzerinde işlenmelidir. |
| Unauthenticated |
Kullanıcı kimliği doğrulanmamışsa alt bileşenleri işler |
| use |
1 veya daha fazla accountIdentifiers verildiğinde, kullanıcı oturum açmışsa Account nesnesini döndürür |
| use |
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 |
| use |
Msal Bağlam değerlerini döndürür |
| use |
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. |
| with |
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 |
Değişkenler
| Msal |
|
| Msal |
|
| version |
İş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
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()
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
MsalContext
version
version: "3.0.29"
Tür
"3.0.29"