@azure/msal-react package

インターフェイス

IMsalContext

関数

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

ユーザーが認証されている場合に子コンポーネントをレンダリングします

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

まだ認証されていない場合にユーザーの認証を試み、子コンポーネントをレンダリングします

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL コンテキスト プロバイダー コンポーネント。 これは、MSAL を使用する他のコンポーネントの上にレンダリングする必要があります。

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

ユーザーが認証されていない場合に子コンポーネントをレンダリングします

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

1 つ以上の accountIdentifiers を指定すると、ユーザーがサインインしている場合は Account オブジェクトを返します

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

ユーザーが現在サインインしているかどうかを返します。 必要に応じて、1 つ以上の accountIdentifier を指定して、特定のユーザーがサインインしているかどうかを判断します

useMsal()

Msal コンテキスト値を返します。

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

ユーザーが現在サインインしていない場合、このフックはログインを呼び出します。 失敗したログインは、返されたログイン コールバックを使用して再試行できます。 ユーザーが現在サインインしている場合、このフックはトークンの取得を試みます。 後続のトークン要求では、返された acquireToken コールバックを使用できます。 必要に応じて、login/acquireToken 呼び出しで使用する要求オブジェクトを指定します。 必要に応じて、ログインする必要がある特定のユーザーを指定します。

withMsal<P>(ComponentType<P>)

高次コンポーネントは、コンポーネントのプロパティに msal コンテキスト値を挿入することで、提供されたコンポーネントを msal でラップします

関数の詳細

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

ユーザーが認証されている場合に子コンポーネントをレンダリングします

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

パラメーター

props

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

返品

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

まだ認証されていない場合にユーザーの認証を試み、子コンポーネントをレンダリングします

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

パラメーター

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

MsalProvider(PropsWithChildren<{ instance: IPublicClientApplication }>)

MSAL コンテキスト プロバイダー コンポーネント。 これは、MSAL を使用する他のコンポーネントの上にレンダリングする必要があります。

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

パラメーター

__namedParameters

PropsWithChildren<{ instance: IPublicClientApplication }>

返品

React.ReactElement

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

ユーザーが認証されていない場合に子コンポーネントをレンダリングします

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

パラメーター

props

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

返品

React.ReactElement | null

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

1 つ以上の accountIdentifiers を指定すると、ユーザーがサインインしている場合は Account オブジェクトを返します

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

パラメーター

accountIdentifiers

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

返品

AccountInfo | null

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

ユーザーが現在サインインしているかどうかを返します。 必要に応じて、1 つ以上の accountIdentifier を指定して、特定のユーザーがサインインしているかどうかを判断します

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

パラメーター

matchAccount

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

返品

boolean

useMsal()

Msal コンテキスト値を返します。

function useMsal(): IMsalContext

返品

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

ユーザーが現在サインインしていない場合、このフックはログインを呼び出します。 失敗したログインは、返されたログイン コールバックを使用して再試行できます。 ユーザーが現在サインインしている場合、このフックはトークンの取得を試みます。 後続のトークン要求では、返された acquireToken コールバックを使用できます。 必要に応じて、login/acquireToken 呼び出しで使用する要求オブジェクトを指定します。 必要に応じて、ログインする必要がある特定のユーザーを指定します。

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

パラメーター

interactionType
InteractionType
authenticationRequest

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

accountIdentifiers

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

返品

withMsal<P>(ComponentType<P>)

高次コンポーネントは、コンポーネントのプロパティに msal コンテキスト値を挿入することで、提供されたコンポーネントを msal でラップします

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

パラメーター

Component

ComponentType<P>

返品

FunctionComponent<Subtract<P, WithMsalProps>>

変数の詳細

MsalConsumer

MsalConsumer: React.Consumer<IMsalContext>

React.Consumer<IMsalContext>

MsalContext

MsalContext: React.Context<IMsalContext>

React.Context<IMsalContext>

version

version: "3.0.29"

"3.0.29"