Documentation
¶
Index ¶
- type Client
- func (c *Client) AuthorizeDevice(ctx context.Context) (*auth.DeviceAuthResponse, error)
- func (c *Client) PollAuthentication(ctx context.Context, deviceCode string) (*auth.AuthenticationResponse, error)
- func (c *Client) RefreshToken(ctx context.Context, refreshToken string) (*auth.RefreshResponse, error)
- func (c *Client) RefreshTokenWithOrganization(ctx context.Context, refreshToken string, ...) (*auth.RefreshResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to WorkOS device code flow authentication.
func NewClient ¶
NewClient creates a new WorkOS client. Audiences are included in token requests so JWTs contain the aud claim. Both the Tero API and PowerSync validate audience.
func (*Client) AuthorizeDevice ¶
AuthorizeDevice initiates the device authorization flow. Returns device_code (for polling), user_code (to show user), and verification URLs.
func (*Client) PollAuthentication ¶
func (c *Client) PollAuthentication(ctx context.Context, deviceCode string) (*auth.AuthenticationResponse, error)
PollAuthentication polls WorkOS to check if the user has completed authentication.
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, refreshToken string) (*auth.RefreshResponse, error)
RefreshToken exchanges a refresh token for a new access token.
func (*Client) RefreshTokenWithOrganization ¶
func (c *Client) RefreshTokenWithOrganization(ctx context.Context, refreshToken string, organizationID domain.WorkosOrganizationID) (*auth.RefreshResponse, error)
RefreshTokenWithOrganization exchanges a refresh token for a new access token scoped to an organization. The organizationID should be the WorkOS organization ID.