Golang Open ID Connect (OIDC) client library.
This library provides OIDC client that mimics standard oauth2 library and gives functionality for communicating with any OIDC-compliant provider.
This package was also inspired by go-oidc package by CoreOS.
package main
import (
"context"
"github.com/bwplotka/oidc"
)
func main() {
// Performs call discovery endpoint to get all the details about provider.
client, err := oidc.NewClient(context.Background(), "https://issuer-oidc.org")
if err != nil {
// handle err
}
extraDiscoveryStuff := map[string]interface{}{}
err = client.Claims(&extraDiscoveryStuff)
if err != nil {
// handler err
}
// For exchanging code into token...
client.Exchange(...)
// For revoking tokens...
client.Revoke(...)
// For OIDC UserInfo...
client.UserInfo(...)
// For IDToken verification...
client.Verifier(...)
// For ID token refreshing...
client.TokenSource(...).OIDCToken(context.Background())
}
See login
Vendoring using submodules. See .gitmodules
- Support 0 port (not pin into exact port)
- Consider moving to structure logger with levels e.g logrus or just drop logging. (I don't like passing std logger in constructor)
Copyright 2017 Bartłomiej Płotka. All Rights Reserved. See LICENSE for licensing terms.