Intro

Kinde x Nordcraft

This Package includes Kinde Authentication inside of Nordcraft. Currenty Supports: Authentication, Roles, Permissions, Token Refreshing.

Demo

Components

  • kinde-auth-context

    Provides a Context for Auth related data, place this everywhere you need something auth related

    Attributes

    auth-callback-urlThe URL which Kinde uses for Callback
    client-idThe Kinde Client ID from your Application
    kinde-urlThe Domain which your Kinde Instance is Hosted
  • kinde-protected-page-context

    This is required for all pages that are 'protected' and not publicly accessible

    Attributes

    redirect-toThe URL to which the user is redirected after an issue occurs while checking the session
    client-idThe Kinde Client ID from your Application
    kinde-urlThe Domain which your Kinde Instance is Hosted

    Events

    onRefreshErrorCalled when an error occurs during session refresh
    onRefreshSuccessCalled after session refresh

    Formulars

    isRefreshingIndicates whether a session refresh is in progress
    userDataThe Kinde User Profile Object
  • kinde-user-permission-context

    User Permission with possible check for required_cehck

    Attributes

    redirect-toThe URL to which the user is redirected after an required_permission not match with user permission
    required_permissionrequired permission
    kinde-urlThe Domain which your Kinde Instance is Hosted

    Formulars

    userPermissionsThe Kinde User Permissions Object
  • kinde-user-roles-context

    User Roles with possible check for required_cehck

    Attributes

    redirect-toThe URL to which the user is redirected after an required_permission not match with user permission
    required_rolerequired role
    kinde-urlThe Domain which your Kinde Instance is Hosted

    Formulars

    userRolesThe Kinde User Roles Object
  • kinde-auth-callback-handler

    Handles the Callback from Kinde and handles the "real" signIn and safes refresh & access tokens, needs kinde-auth-context as parent

    Events

    onSuccessCalled after successful signIn
    onErrorCalled after failed signIn
  • kinde-refresh-session-handler

    Used for session update if protected route has error, needs kinde-auth-context as parent

    Events

    onErrorCalled when error occurs during session refresh
    onSuccessCalled when refresh was successful

Formulas

  • hasPermission

    Simplified formular for checking if user has Permission

    Arguments

    userPermissionsThe userPermission Data from Auth Context
    requiredPermissonsThe Required Permission to get "true" value
  • getKindeLoginUrl

    Needs Kinde-Auth-Context arround

    Arguments

    login_hintSee Kinde.com docs
  • getKindeLogoutUrl

    Provides the LogoutUrl for Kinde

Cookies

  • kinde_access_tokenThe Access Token which can be used for requests etc...
    kinde_refresh_tokenRefresh Token (u don‘t need it)