Interface AuthApiInterface

The Authentication API provides methods to log in or out, information about the current user, and a signal for when the logged-in user changes.

Hierarchy

  • AuthApiInterface

Properties

currentUser: UserEntityInterface

Information about the currently logged in user. Will be a "guest" user if not logged in.

onAuthenticationChanged: Signal<AuthenticationChangedHandler>

Signal that is emitted after a user logged in or out. After logging out, the user will be a "guest" user.

Methods

  • Retrieves the locally stored JWT that can be used to authenticate requests.

    Returns

    the locally stored JWT.

    Returns string

  • Logs in a user with the provided credentials.

    Note that this will only work with local NavVis IVION accounts, not with OAuth or pre-authentication.

    Returns

    A promise that is resolved after successful login and rejected if e.g. the provided credentials are invalid.

    Parameters

    • username: string

      Name of the user.

    • password: string

      Password of the user.

    • Optional awaitDataLoad: boolean

      Optional flag that determines whether the returned promise should wait for the full initialization of NavVis IVION. Needs to be set true if the login promise is chained with some API functions. Defaults to false.

    Returns Promise<UserEntityInterface>

  • Logs in a user with the provided JWT, either for local NavVis IVION accounts or e.g. for OAuth Resource Server if the instance is set up to use one.

    Note that it also removes logout functionality from the UI and that NavVis IVION will not automatically refresh the token when it is about to expire. Use updateToken to apply an updated token before the previous one expires.

    Returns

    A promise that is resolved after successful login and rejected if e.g. the provided token is invalid.

    Parameters

    • token: string

      Valid JWT.

    • Optional awaitDataLoad: boolean

      Optional flag that determines whether the returned promise should wait for the full initialization of NavVis IVION. Needs to be set true if the login promise is chained with some API functions. Defaults to false.

    Returns Promise<UserEntityInterface>

  • Logs in a user with the provided JWTs, either for local NavVis IVION accounts or e.g. for OAuth Resource Server if the instance is set up to use one.

    Note that it also removes logout functionality from the UI and that NavVis IVION will not automatically refresh the token when it is about to expire. Use updateToken to apply an updated token before the previous one expires.

    Returns

    A promise that is resolved after successful login and rejected if e.g. the provided token is invalid.

    Parameters

    • accessToken: string

      Valid JWT.

    • uploadToken: string

      Valid JWT for uploads.

    • Optional awaitDataLoad: boolean

      Optional flag that determines whether the returned promise should wait for the full initialization of NavVis IVION. Needs to be set true if the login promise is chained with some API functions. Defaults to false.

    Returns Promise<UserEntityInterface>

  • Logs out the currently logged in user.

    Returns

    A promise that is resolved after the logout.

    Returns Promise<void>

  • Updates the locally stored JWT access token such that it will be used to authenticate future requests.

    Parameters

    • token: string

      Valid JWT access token.

    • Optional uploadToken: string

      Optional, valid JWT for uploads.

    Returns void

Generated using TypeDoc