openid

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUrlRequest

type AuthUrlRequest struct {
	Realm       string `url:"realm" json:"realm"`               // Authentication domain ID
	RedirectUrl string `url:"redirect-url" json:"redirect-url"` // Redirection Url. The client should set this to the used server url (location.origin).

}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) AuthUrl

func (c *Client) AuthUrl(ctx context.Context, req AuthUrlRequest) (string, error)

AuthUrl Get the OpenId Authorization Url for the specified realm.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]IndexResponse, error)

Index Directory index.

func (*Client) Login

func (c *Client) Login(ctx context.Context, req LoginRequest) (LoginResponse, error)

Login Verify OpenID authorization code and create a ticket.

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexResponse

type IndexResponse struct {
	Subdir string `url:"subdir" json:"subdir"`
}

type LoginRequest

type LoginRequest struct {
	Code        string `url:"code" json:"code"`                 // OpenId authorization code.
	RedirectUrl string `url:"redirect-url" json:"redirect-url"` // Redirection Url. The client should set this to the used server url (location.origin).
	State       string `url:"state" json:"state"`               // OpenId state.

}

type LoginResponse

type LoginResponse struct {
	Cap                 map[string]interface{} `url:"cap" json:"cap"`
	Csrfpreventiontoken string                 `url:"CSRFPreventionToken" json:"CSRFPreventionToken"`
	Ticket              string                 `url:"ticket" json:"ticket"`
	Username            string                 `url:"username" json:"username"`

	// The following parameters are optional
	Clustername *string `url:"clustername,omitempty" json:"clustername,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL