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

    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
    userPermissionsThe Kinde User Permissions Object
    userRolesThe Kinde User Roles Object
  • kinde-permission-guard

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

    Attributes

    required-permissionThe Permission the User is Required to see Content

    Slots

    defaultShows Content if User has right Permission
    no-permissionIf the User hasn't the right Permission
  • 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
  • kinde-logout-button

    Provides an "A-TAG" which holds the Logout URL from Kinde, onClick it removes the Auth related Cookies

  • kinde-login-button

    Provides an "A-TAG" which holds the Login URL from Kinde

Formulas

  • hasPermission

    Simplified formular for checking if user has Permission

    Arguments

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

Cookies

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