2.1.2 • Published 6 months ago

@moreillon/oidc-auth v2.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

OIDC Auth

A simple class that enforces authentication using OpenID Connect / Oauth2.0

Usage

Example with Vue.js

import OidcClient from "@moreillon/oidc-auth"

const { VITE_APP_OIDC_AUTHORITY, VITE_APP_OIDC_CLIENT_ID } = import.meta.env

const oidcClient = new OidcClient({
  redirect_uri: `${window.location.origin}/callback`,
  authority: VITE_OIDC_AUTHORITY,
  client_id: VITE_OIDC_CLIENT_ID,
  extraQueryParams: {
    audience: VITE_OIDC_AUDIENCE,
  },
})

async function main() {
  const result = await oidcClient.init()
  if (!result) return
  const { user } = result

  oidcClient.onTokenRefreshed((oidcData) => {
    console.log("Token refreshed")
    console.log(oidcData)
  })
}

main()
2.1.2

6 months ago

2.0.3

8 months ago

2.1.1

6 months ago

2.0.2

8 months ago

2.0.5

7 months ago

2.0.4

8 months ago

2.0.6

7 months ago

2.1.0

6 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago