Skip to content

An OpenID Connect client for the browser, using @muze-nl/metro

License

Notifications You must be signed in to change notification settings

muze-nl/oidc-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oidc-client: OpenID Connect client using Metro and middleware

Project stage: Experimental

import oidcClient from '@muze-nl/oidc-client'

async function main() {
  const client = new oidcClient()
  try {
    const session = await client.signIn('https://solidcommunity.net/')
    if (session.isAuthenticated()) {
      const file = await session.get(fileURL) // fill this in
      await session.signOut()
    }
  } catch(err) {
    alert(err)
  }
}

Installation

npm i @muze-nl/oidc-client

Or use a CDN:

<script src="https://cdn.jsdelivr.net/npm/@muze-nl/oidc-client/dist/browser.min.js"></script>

Metro

The oidcClient extends the metro client, so it supports all the things that metro does, including middleware. Read more about metro here It also uses the metro-oidc middleware, any options you want to pass on to that, you must pass on in the .oidc options property in the constructor, like this:

import oidcClient from '@muze-nl/oidc-client'

const client = new oidcClient({
  oidc: {
    client_info: {
      client_name: 'My oidc client'
    }
  }
})

About

An OpenID Connect client for the browser, using @muze-nl/metro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published