authentication

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewForce

func NewForce() (*force.ForceApiInterface, error)

func NewForceKeyStringSecret

func NewForceKeyStringSecret() (*force.ForceApiInterface, error)

func NewOAuthForce

func NewOAuthForce() (*force.ForceApiInterface, error)

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	URL      string `json:"url"`
	Username string `json:"username"`
	ClientID string `json:"-"`
}

type AuthenticationResponse

type AuthenticationResponse interface {
	GetToken() string
	GetInstanceURL() string
	GetID() string
	GetTokenType() string
	GetIssuedAt() string
	GetSignature() string
}

func Authenticate

func Authenticate(request AuthenticationRequest, privateKey io.ReadCloser, client *http.Client) (AuthenticationResponse, error)

Authenticate will exchange the JWT signed request for access token.

type DeviceClaims

type DeviceClaims struct {
	Audience string `json:"aud"`
	// Audience aus dem RegisteredClaims wird standardkonform in ein Array umgewandelt
	// Salesforce akzeptiert hier jedoch nur Strings
	jwt.RegisteredClaims
}

DeviceClaims represents the needed claims for the server-to-server oauth flow https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_jwt_flow.htm&type=5

type OAuthHandler

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

OAuthHandler implements the http.Handler interface and shares the token with our code

func (*OAuthHandler) ServeHTTP

func (s *OAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP waits for the user of this application to finish logging in with Salesforce on the site printed by promptUser() and accepts the request from the redirected user. The authentication code is sent as a query parameter.

Jump to

Keyboard shortcuts

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