Categorygithub.com/luikyv/go-oidc
module
0.6.1
Repository: https://github.com/luikyv/go-oidc.git
Documentation: pkg.go.dev

# README

go-oidc - A Configurable OpenID Provider built in Go.

Go Reference Go Report Card

go-oidc is a client module that provides a configurable Authorization Server with support for OpenID Connect and other standards.

This library implements the following specifications:

Certification

Luiky Vasconcelos has certified that go-oidc conforms to the following profile of the OpenID Connect™ protocol.

  • Basic OP
  • FAPI 2.0

OpenID Certification

Get Started

To start using the go-oidc module in your project, install it with

go get github.com/luikyv/go-oidc@latest

Once installed, you can instantiate an openid provider and run it as shown below.

key, _ := rsa.GenerateKey(rand.Reader, 2048)
jwk := goidc.JSONWebKey{
  KeyID:     "server_key",
  Key:       key,
  Algorithm: string(goidc.RS256),
  Use:       string(goidc.KeyUsageSignature),
}

op, _ := provider.New(
  goidc.ProfileOpenID,
  "http://localhost",
  func(_ context.Context) (goidc.JSONWebKeySet, error) {
    return goidc.JSONWebKeySet{
      Keys: []goidc.JSONWebKey{jwk},
    }, nil
  },
)
op.Run(":80")

You can then check the default configurations by accessing http://localhost/.well-known/openid-configuration.

# Packages

No description provided by the author
No description provided by the author