Skip to content

okzk/go-ciba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ciba

OpenID Connect CIBA flow client for golang.

Usage

package main

import (
	"context"
	"fmt"
	"github.com/okzk/go-ciba"
)

func main() {
	client := ciba.NewClient(
		"https://example.com",          // issuer
		"https://example.com/bc-authn", // backchannel_authentication_endpoint
		"https://example.com/token",    // token_endpoint
		"openid",                       // scope
		"sample_client",                // client_id
		"xxxxxxxxxxxxxxxxxxxxx",        // client_secret
	)

	ctx := context.Background()
	token, err := client.Authenticate(ctx, ciba.LoginHint("alice"))
	if err != nil {
		panic(err)
	}

	claims := token.Claims()
	fmt.Println(claims["sub"])
}

Limitations

  • Support poll mode only.
  • Support client_secret_basic only.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages