1.0.5 • Published 2 years ago

simple-openid-client v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Simple openid Client

Client PUBLIC

when client public we gona use PKCE

const OpenIdClient = new OpenIdClientClass();

await OpenIdClient.init({
  client_id: "ESPECIAL_CLIENT_ID",
  redirect_uris: ["http://localhost:3000/"],
  response_types: ["code"],
  grant_type: "authorization_code",
  authority: "https://openid.authserver.com/",
})

const url = await OpenIdClient.getRedirectUrl();
const token = await OpenIdClient.getTokens("lookMyCode")

Client CONFIDENTIAL

when client public we gona use secret ** only use CONFIDENTIAL, if can store secret in a safe way

const OpenIdClient = new OpenIdClientClass();

await OpenIdClient.init({
  client_id: "ESPECIAL_CLIENT_ID",
  client_secret: "ESPECIAL_CLIENT_SECRET",
  redirect_uris: ["http://localhost:3000/"],
  response_types: ["code"],
  grant_type: "authorization_code",
  authority: "https://openid.authserver.com/",
})

const url = await OpenIdClient.getRedirectUrl();
const token = await OpenIdClient.getTokens("lookMyCode")
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago