Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(req *http.Request, payload []byte, date time.Time, apiKeyID string, ...)
- func GetToken(href string) string
- func Init(clientConfiguration ClientConfiguration, cache Cache)
- func InitLog()
- func JWT(claims jwt.Claims, extraHeaders map[string]interface{}) string
- func NewPageRequest(limit int, offset int) url.Values
- func ParseJWT(token string, claims jwt.Claims) *jwt.Token
- type APIKey
- type APIKeyCriteria
- type APIKeys
- type AccessTokenClaims
- type Account
- func (account *Account) AddToGroup(group *Group) (*GroupMembership, error)
- func (account *Account) CreateAPIKey() (*APIKey, error)
- func (r *Account) DeleteCustomData() error
- func (account *Account) GetAccessTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
- func (r *Account) GetCustomData() (CustomData, error)
- func (account *Account) GetGroupMemberships(criteria Criteria) (*GroupMemberships, error)
- func (account *Account) GetRefreshTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
- func (account *Account) Refresh() error
- func (account *Account) RemoveFromGroup(group *Group) error
- func (account *Account) Update() error
- func (r *Account) UpdateCustomData(customData CustomData) (CustomData, error)
- type AccountCreationPolicy
- func (r *AccountCreationPolicy) Delete() error
- func (policy *AccountCreationPolicy) GetVerificationEmailTemplates() (*EmailTemplates, error)
- func (policy *AccountCreationPolicy) GetVerificationSuccessEmailTemplates() (*EmailTemplates, error)
- func (policy *AccountCreationPolicy) GetWelcomeEmailTemplates() (*EmailTemplates, error)
- func (r AccountCreationPolicy) IsCacheable() bool
- func (policy *AccountCreationPolicy) Refresh() error
- func (policy *AccountCreationPolicy) Update() error
- type AccountCriteria
- func (c AccountCriteria) EmailEq(email string) AccountCriteria
- func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
- func (c AccountCriteria) Limit(limit int) Criteria
- func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
- func (c AccountCriteria) Offset(offset int) Criteria
- func (c AccountCriteria) StatusEq(status string) AccountCriteria
- func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
- func (c AccountCriteria) ToQueryString() string
- func (c AccountCriteria) UsernameEq(username string) AccountCriteria
- func (c AccountCriteria) WithAPIKeys() AccountCriteria
- func (c AccountCriteria) WithApplications() AccountCriteria
- func (c AccountCriteria) WithCustomData() AccountCriteria
- func (c AccountCriteria) WithDirectory() AccountCriteria
- func (c AccountCriteria) WithGroupMemberships(pageRequest PageRequest) AccountCriteria
- func (c AccountCriteria) WithGroups(pageRequest PageRequest) AccountCriteria
- func (c AccountCriteria) WithProviderData() AccountCriteria
- func (c AccountCriteria) WithTenant() AccountCriteria
- type AccountPasswordResetToken
- type AccountStoreMapping
- type AccountStoreMappingCriteria
- type AccountStoreMappings
- type Accounts
- type Application
- func (app *Application) AuthenticateAccount(username string, password string) (*Account, error)
- func (app *Application) CreateGroup(group *Group) error
- func (app *Application) CreateIDSiteURL(options IDSiteOptions) (string, error)
- func (app *Application) GetAPIKey(apiKeyID string, criteria APIKeyCriteria) (*APIKey, error)
- func (app *Application) GetAccountStoreMappings(criteria Criteria) (*AccountStoreMappings, error)
- func (r *Application) GetAccounts(criteria Criteria) (*Accounts, error)
- func (app *Application) GetDefaultAccountStoreMapping(criteria Criteria) (*AccountStoreMapping, error)
- func (app *Application) GetGroups(criteria Criteria) (*Groups, error)
- func (app *Application) GetOAuthPolicy() (*OAuthPolicy, error)
- func (app *Application) GetOAuthToken(username string, password string) (*OAuthResponse, error)
- func (app *Application) GetOAuthTokenStormpathGrantType(token string) (*OAuthResponse, error)
- func (app *Application) HandleCallback(URL string) (*CallbackResult, error)
- func (app *Application) Purge() error
- func (app *Application) Refresh() error
- func (app *Application) RefreshOAuthToken(refreshToken string) (*OAuthResponse, error)
- func (app *Application) RegisterAccount(account *Account) error
- func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (app *Application) ResendVerificationEmail(email string) error
- func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
- func (app *Application) SendPasswordResetEmail(email string) (*AccountPasswordResetToken, error)
- func (app *Application) Update() error
- func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
- func (app *Application) ValidateToken(token string) (*OAuthToken, error)
- type ApplicationCriteria
- func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
- func (c ApplicationCriteria) Limit(limit int) Criteria
- func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
- func (c ApplicationCriteria) Offset(offset int) Criteria
- func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
- func (c ApplicationCriteria) ToQueryString() string
- func (c ApplicationCriteria) WithAccessTokens(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithAccountStoreMappings(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithAccounts(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithCustomData() ApplicationCriteria
- func (c ApplicationCriteria) WithDefaultAccountStoreMapping() ApplicationCriteria
- func (c ApplicationCriteria) WithDefaultGroupStoreMapping() ApplicationCriteria
- func (c ApplicationCriteria) WithGroups(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithRefreshTokens(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithTenant() ApplicationCriteria
- type Applications
- type AuthResult
- type AuthenticationResult
- type Authenticator
- type BasicAuthenticator
- type Cache
- type Cacheable
- type CallbackResult
- type Claims
- type Client
- type ClientConfiguration
- type Criteria
- type CustomData
- type Directories
- type Directory
- func GetDirectory(href string, criteria Criteria) (*Directory, error)
- func NewDirectory(name string) *Directory
- func NewFacebookDirectory(name string, clientID string, clientSecret string) *Directory
- func NewGithubDirectory(name string, clientID string, clientSecret string) *Directory
- func NewGoogleDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
- func NewLinkedInDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
- func (dir *Directory) CreateGroup(group *Group) error
- func (dir *Directory) GetAccountCreationPolicy() (*AccountCreationPolicy, error)
- func (r *Directory) GetAccounts(criteria Criteria) (*Accounts, error)
- func (dir *Directory) GetGroups(criteria Criteria) (*Groups, error)
- func (dir *Directory) Refresh() error
- func (dir *Directory) RegisterAccount(account *Account) error
- func (dir *Directory) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (dir *Directory) Update() error
- type DirectoryCriteria
- func (c DirectoryCriteria) DescriptionEq(description string) DirectoryCriteria
- func (c DirectoryCriteria) Limit(limit int) Criteria
- func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
- func (c DirectoryCriteria) Offset(offset int) Criteria
- func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
- func (c DirectoryCriteria) ToQueryString() string
- func (c DirectoryCriteria) WithAccountCreationPolicy() DirectoryCriteria
- func (c DirectoryCriteria) WithAccounts(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithCustomData() DirectoryCriteria
- func (c DirectoryCriteria) WithGroups(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithPasswordPolicy() DirectoryCriteria
- func (c DirectoryCriteria) WithProvider() DirectoryCriteria
- func (c DirectoryCriteria) WithTenant() DirectoryCriteria
- type EmailTemplate
- type EmailTemplates
- type Error
- type ExpandedJWT
- type GrantTypeClientCredentialsTokenClaims
- type GrantTypeStormpathTokenClaims
- type Group
- type GroupCriteria
- func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
- func (c GroupCriteria) Limit(limit int) Criteria
- func (c GroupCriteria) NameEq(name string) GroupCriteria
- func (c GroupCriteria) Offset(offset int) Criteria
- func (c GroupCriteria) StatusEq(status string) GroupCriteria
- func (c GroupCriteria) ToQueryString() string
- func (c GroupCriteria) WithAccounts(pageRequest PageRequest) GroupCriteria
- func (c GroupCriteria) WithCustomData() GroupCriteria
- func (c GroupCriteria) WithDirectory() GroupCriteria
- func (c GroupCriteria) WithTenant() GroupCriteria
- type GroupMembership
- type GroupMembershipCriteria
- func (c GroupMembershipCriteria) Limit(limit int) Criteria
- func (c GroupMembershipCriteria) Offset(offset int) Criteria
- func (c GroupMembershipCriteria) ToQueryString() string
- func (c GroupMembershipCriteria) WithAccount() GroupMembershipCriteria
- func (c GroupMembershipCriteria) WithGroup() GroupMembershipCriteria
- type GroupMemberships
- type Groups
- type Header
- type IDSiteAssertionTokenClaims
- type IDSiteOptions
- type LocalCache
- type OAuthAccessTokenResult
- type OAuthBearerAuthenticator
- type OAuthClientCredentialsAuthenticationResult
- type OAuthClientCredentialsAuthenticator
- type OAuthPasswordAuthenticator
- type OAuthPolicy
- type OAuthProvider
- type OAuthRefreshTokenAuthenticator
- type OAuthRequestAuthenticator
- type OAuthResponse
- type OAuthStormpathTokenAuthenticator
- type OAuthToken
- type OAuthTokenCriteria
- type OAuthTokens
- type PageRequest
- type PasswordPolicy
- func (r *PasswordPolicy) Delete() error
- func (policy *PasswordPolicy) GetResetEmailTemplates() (*EmailTemplates, error)
- func (policy *PasswordPolicy) GetResetSuccessEmailTemplates() (*EmailTemplates, error)
- func (r PasswordPolicy) IsCacheable() bool
- func (policy *PasswordPolicy) Refresh() error
- func (policy *PasswordPolicy) Update() error
- type Provider
- type ProviderData
- type SAMLAssertionTokenClaims
- type SAMLAuthenticationTokenClaims
- type SSOTokenClaims
- type ScopeFactoryFunc
- type SocialAccount
- type StormpathAssertionAuthenticationResult
- type StormpathAssertionAuthenticator
- type Tenant
- func (tenant *Tenant) CreateApplication(app *Application) error
- func (tenant *Tenant) CreateDirectory(dir *Directory) error
- func (r *Tenant) DeleteCustomData() error
- func (tenant *Tenant) GetApplications(criteria Criteria) (*Applications, error)
- func (r *Tenant) GetCustomData() (CustomData, error)
- func (tenant *Tenant) GetDirectories(criteria Criteria) (*Directories, error)
- func (r *Tenant) UpdateCustomData(customData CustomData) (CustomData, error)
Constants ¶
const ( Name = "name" Description = "description" Status = "status" )
const ( Facebook = "facebook" Google = "google" GitHub = "github" LinkedIn = "linkedin" )
const ( IDTerminator = "sauthc1_request" AuthenticationScheme = "SAuthc1" NL = "\n" HostHeader = "Host" AuthorizationHeader = "Authorization" StormpathDateHeader = "X-Stormpath-Date" Algorithm = "HMAC-SHA-256" SAUTHC1Id = "sauthc1Id" SAUTHC1SignedHeaders = "sauthc1SignedHeaders" SAUTHC1Signature = "sauthc1Signature" DateFormat = "20060102" TimestampFormat = "20060102T150405Z0700" EQ = '=' SPACE = ' ' SLASH = '/' AMP = '&' CS = ", " COMMA = ',' COLON = ':' SemiColon = ';' EMPTY = "" )
SAuthc1 algorithm constants
const ( Enabled = "ENABLED" Disabled = "DISABLED" Unverified = "UNVERIFIED" ApplicationJSON = "application/json" ApplicationFormURLencoded = "application/x-www-form-urlencoded" TextPlain = "text/plain" TextHTML = "text/html" ContentTypeHeader = "Content-Type" AcceptHeader = "Accept" UserAgentHeader = "User-Agent" )
Variables ¶
var DefaultPageRequest = PageRequest{25, 0}
var Logger *log.Logger
Logger library wide logger
Functions ¶
func Authenticate ¶
func Authenticate(req *http.Request, payload []byte, date time.Time, apiKeyID string, apiKeySecret string, nonce string)
Authenticate generates the proper authentication header for the SAuthc1 algorithm use by Stormpath
func Init ¶
func Init(clientConfiguration ClientConfiguration, cache Cache)
Init initializes the underlying client that communicates with Stormpath
func JWT ¶
JWT helper function to create JWT token strings with the given claims, extra header values, and sign with client API Key Secret using SigningMethodHS256 algorithm
func NewPageRequest ¶
NewPageRequest is a conviniece constructor for a PageRequest
Types ¶
type APIKey ¶
type APIKey struct { ID string `json:"id"` Secret string `json:"secret"` Status string `json:"status"` Account *Account `json:"account"` Tenant *Tenant `json:"tenant"` // contains filtered or unexported fields }
func (APIKey) IsCacheable ¶
func (r APIKey) IsCacheable() bool
type APIKeyCriteria ¶
type APIKeyCriteria struct {
// contains filtered or unexported fields
}
func MakeAPIKeyCriteria ¶
func MakeAPIKeyCriteria() APIKeyCriteria
func MakeAPIKeysCriteria ¶
func MakeAPIKeysCriteria() APIKeyCriteria
func (APIKeyCriteria) ToQueryString ¶
func (c APIKeyCriteria) ToQueryString() string
func (APIKeyCriteria) WithAccount ¶
func (c APIKeyCriteria) WithAccount() APIKeyCriteria
func (APIKeyCriteria) WithTenant ¶
func (c APIKeyCriteria) WithTenant() APIKeyCriteria
type APIKeys ¶
type APIKeys struct { Items []APIKey `json:"items,omitempty"` // contains filtered or unexported fields }
func (APIKeys) IsCacheable ¶
func (r APIKeys) IsCacheable() bool
type AccessTokenClaims ¶
type AccessTokenClaims struct { jwt.StandardClaims RefreshTokenID string `json:"rti,omitempty"` }
AccessTokenClaims are the JWT for a Stormpath OAuth2 access token
type Account ¶
type Account struct { Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` FullName string `json:"fullName,omitempty"` GivenName string `json:"givenName,omitempty"` MiddleName string `json:"middleName,omitempty"` Surname string `json:"surname,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` GroupMemberships *GroupMemberships `json:"groupMemberships,omitempty"` Directory *Directory `json:"directory,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` EmailVerificationToken *resource `json:"emailVerificationToken"` AccessTokens *OAuthTokens `json:"accessTokens,omitempty"` RefreshTokens *OAuthTokens `json:"refreshTokens,omitempty"` ProviderData *ProviderData `json:"providerData,omitempty"` APIKeys *APIKeys `json:"apiKeys,omitempty"` Applications *Applications `json:"applications,omitempty"` // contains filtered or unexported fields }
Account represents an Stormpath account object
See: http://docs.stormpath.com/rest/product-guide/#accounts
func GetAccount ¶
GetAccount fetches an account by href and criteria
func NewAccount ¶
NewAccount returns a pointer to an Account with the minimum data required
func VerifyEmailToken ¶
VerifyEmailToken verifies an email verification token associated with an account
See: http://docs.stormpath.com/rest/product-guide/#account-verify-email
func (*Account) AddToGroup ¶
func (account *Account) AddToGroup(group *Group) (*GroupMembership, error)
AddToGroup adds the given account to a given group and returns the respective GroupMembership
func (*Account) CreateAPIKey ¶
func (*Account) DeleteCustomData ¶
func (r *Account) DeleteCustomData() error
DeleteCustomData deletes all the resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Account) GetAccessTokens ¶
func (account *Account) GetAccessTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
GetAccessTokens returns the acounts's accessToken collection
func (*Account) GetCustomData ¶
func (r *Account) GetCustomData() (CustomData, error)
GetCustomData returns the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Account) GetGroupMemberships ¶
func (account *Account) GetGroupMemberships(criteria Criteria) (*GroupMemberships, error)
GetGroupMemberships returns a paged result of the group memeberships of the given account
func (*Account) GetRefreshTokens ¶
func (account *Account) GetRefreshTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
GetRefreshTokens returns the account's refreshToken collection
func (*Account) Refresh ¶
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Account) RemoveFromGroup ¶
RemoveFromGroup removes the given account from the given group by searching the account groupmemberships, and deleting the corresponding one
func (*Account) UpdateCustomData ¶
func (r *Account) UpdateCustomData(customData CustomData) (CustomData, error)
UpdateCustomData sets or updates the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
type AccountCreationPolicy ¶
type AccountCreationPolicy struct { VerificationEmailStatus string `json:"verificationEmailStatus,omitempty"` VerificationEmailTemplates *EmailTemplates `json:"verificationEmailTemplates,omitempty"` VerificationSuccessEmailStatus string `json:"verificationSuccessEmailStatus,omitempty"` VerificationSuccessEmailTemplates *EmailTemplates `json:"verificationSuccessEmailTemplates,omitempty"` WelcomeEmailStatus string `json:"welcomeEmailStatus,omitempty"` WelcomeEmailTemplates *EmailTemplates `json:"welcomeEmailTemplates,omitempty"` // contains filtered or unexported fields }
AccountCreationPolicy represents a directory account creation policy object
See: http://docs.stormpath.com/rest/product-guide/#directory-account-creation-policy
func (*AccountCreationPolicy) Delete ¶
func (r *AccountCreationPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*AccountCreationPolicy) GetVerificationEmailTemplates ¶
func (policy *AccountCreationPolicy) GetVerificationEmailTemplates() (*EmailTemplates, error)
GetVerificationEmailTemplates loads the policy VerificationEmailTemplates collection and returns it
func (*AccountCreationPolicy) GetVerificationSuccessEmailTemplates ¶
func (policy *AccountCreationPolicy) GetVerificationSuccessEmailTemplates() (*EmailTemplates, error)
GetVerificationSuccessEmailTemplates loads the policy VerificationSuccessEmailTemplates collection and returns it
func (*AccountCreationPolicy) GetWelcomeEmailTemplates ¶
func (policy *AccountCreationPolicy) GetWelcomeEmailTemplates() (*EmailTemplates, error)
GetWelcomeEmailTemplates loads the policy WelcomeEmailTemplates collection and returns it
func (AccountCreationPolicy) IsCacheable ¶
func (r AccountCreationPolicy) IsCacheable() bool
func (*AccountCreationPolicy) Refresh ¶
func (policy *AccountCreationPolicy) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*AccountCreationPolicy) Update ¶
func (policy *AccountCreationPolicy) Update() error
Update updates the given resource, by doing a POST to the resource Href
type AccountCriteria ¶
type AccountCriteria struct {
// contains filtered or unexported fields
}
func MakeAccountCriteria ¶
func MakeAccountCriteria() AccountCriteria
func MakeAccountsCriteria ¶
func MakeAccountsCriteria() AccountCriteria
func (AccountCriteria) EmailEq ¶
func (c AccountCriteria) EmailEq(email string) AccountCriteria
func (AccountCriteria) GivenNameEq ¶
func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
func (AccountCriteria) MiddleNameEq ¶
func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
func (AccountCriteria) StatusEq ¶
func (c AccountCriteria) StatusEq(status string) AccountCriteria
func (AccountCriteria) SurnameEq ¶
func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
func (AccountCriteria) ToQueryString ¶
func (c AccountCriteria) ToQueryString() string
func (AccountCriteria) UsernameEq ¶
func (c AccountCriteria) UsernameEq(username string) AccountCriteria
func (AccountCriteria) WithAPIKeys ¶
func (c AccountCriteria) WithAPIKeys() AccountCriteria
func (AccountCriteria) WithApplications ¶
func (c AccountCriteria) WithApplications() AccountCriteria
func (AccountCriteria) WithCustomData ¶
func (c AccountCriteria) WithCustomData() AccountCriteria
func (AccountCriteria) WithDirectory ¶
func (c AccountCriteria) WithDirectory() AccountCriteria
func (AccountCriteria) WithGroupMemberships ¶
func (c AccountCriteria) WithGroupMemberships(pageRequest PageRequest) AccountCriteria
func (AccountCriteria) WithGroups ¶
func (c AccountCriteria) WithGroups(pageRequest PageRequest) AccountCriteria
func (AccountCriteria) WithProviderData ¶
func (c AccountCriteria) WithProviderData() AccountCriteria
func (AccountCriteria) WithTenant ¶
func (c AccountCriteria) WithTenant() AccountCriteria
type AccountPasswordResetToken ¶
AccountPasswordResetToken represents an password reset token for a given account
See: http://docs.stormpath.com/rest/product-guide/#application-accounts (Reset An Account’s Password)
type AccountStoreMapping ¶
type AccountStoreMapping struct { ListIndex *int `json:"collectionResourceIndex,omitempty"` IsDefaultAccountStore *bool `json:"isDefaultAccountStore,omitempty"` IsDefaultGroupStore *bool `json:"isDefaultGroupStore,omitempty"` Application *Application `json:"application,omitempty"` AccountStore *resource `json:"accountStore,omitempty"` // contains filtered or unexported fields }
AccountStoreMapping represents an Stormpath account store mapping
See: http://docs.stormpath.com/rest/product-guide/#account-store-mappings
func NewAccountStoreMapping ¶
func NewAccountStoreMapping(applicationHref string, accountStoreHref string) *AccountStoreMapping
NewAccountStoreMapping creates a new account store mappings
func (*AccountStoreMapping) Delete ¶
func (r *AccountStoreMapping) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*AccountStoreMapping) IsAccountStoreDirectory ¶
func (mapping *AccountStoreMapping) IsAccountStoreDirectory() bool
func (AccountStoreMapping) IsCacheable ¶
func (r AccountStoreMapping) IsCacheable() bool
func (*AccountStoreMapping) Save ¶
func (mapping *AccountStoreMapping) Save() error
Save saves the given account store mapping
type AccountStoreMappingCriteria ¶
type AccountStoreMappingCriteria struct {
// contains filtered or unexported fields
}
func MakeAccountStoreMappingCriteria ¶
func MakeAccountStoreMappingCriteria() AccountStoreMappingCriteria
func MakeAccountStoreMappingsCriteria ¶
func MakeAccountStoreMappingsCriteria() AccountStoreMappingCriteria
func (AccountStoreMappingCriteria) ToQueryString ¶
func (c AccountStoreMappingCriteria) ToQueryString() string
func (AccountStoreMappingCriteria) WithApplication ¶
func (c AccountStoreMappingCriteria) WithApplication() AccountStoreMappingCriteria
type AccountStoreMappings ¶
type AccountStoreMappings struct { Items []AccountStoreMapping `json:"items,omitempty"` // contains filtered or unexported fields }
AccountStoreMappings represents a pages result of account store mappings
See: http://docs.stormpath.com/rest/product-guide/#collectionResource-account-store-mappings
func (AccountStoreMappings) IsCacheable ¶
func (r AccountStoreMappings) IsCacheable() bool
type Accounts ¶
type Accounts struct { Items []Account `json:"items,omitempty"` // contains filtered or unexported fields }
Accounts represents a paged result of Account objects
See: http://docs.stormpath.com/rest/product-guide/#accounts-collectionResource
func (Accounts) IsCacheable ¶
func (r Accounts) IsCacheable() bool
type Application ¶
type Application struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` PasswordResetTokens *resource `json:"passwordResetTokens,omitempty"` AccountStoreMappings *AccountStoreMappings `json:"accountStoreMappings,omitempty"` DefaultAccountStoreMapping *AccountStoreMapping `json:"defaultAccountStoreMapping,omitempty"` DefaultGroupStoreMapping *AccountStoreMapping `json:"defaultGroupStoreMapping,omitempty"` OAuthPolicy *OAuthPolicy `json:"oAuthPolicy,omitempty"` APIKeys *APIKeys `json:"apiKeys,omitempty"` // contains filtered or unexported fields }
Application represents a Stormpath application object
See: http://docs.stormpath.com/rest/product-guide/#applications
func GetApplication ¶
func GetApplication(href string, criteria Criteria) (*Application, error)
GetApplication loads an application by href and criteria
func NewApplication ¶
func NewApplication(name string) *Application
NewApplication creates a new application
func (*Application) AuthenticateAccount ¶
func (app *Application) AuthenticateAccount(username string, password string) (*Account, error)
AuthenticateAccount authenticates an account against the application
See: http://docs.stormpath.com/rest/product-guide/#authenticate-an-account
func (*Application) CreateGroup ¶
func (app *Application) CreateGroup(group *Group) error
CreateGroup creates a new group in the application
See: http://docs.stormpath.com/rest/product-guide/#application-groups
func (*Application) CreateIDSiteURL ¶
func (app *Application) CreateIDSiteURL(options IDSiteOptions) (string, error)
CreateIDSiteURL creates the IDSite URL for the application
func (*Application) GetAPIKey ¶
func (app *Application) GetAPIKey(apiKeyID string, criteria APIKeyCriteria) (*APIKey, error)
func (*Application) GetAccountStoreMappings ¶
func (app *Application) GetAccountStoreMappings(criteria Criteria) (*AccountStoreMappings, error)
GetAccountStoreMappings returns all the applications account store mappings
See: http://docs.stormpath.com/rest/product-guide/#application-account-store-mappings
func (*Application) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Application) GetDefaultAccountStoreMapping ¶
func (app *Application) GetDefaultAccountStoreMapping(criteria Criteria) (*AccountStoreMapping, error)
func (*Application) GetGroups ¶
func (app *Application) GetGroups(criteria Criteria) (*Groups, error)
GetGroups returns all the application groups
See: http://docs.stormpath.com/rest/product-guide/#application-groups
func (*Application) GetOAuthPolicy ¶
func (app *Application) GetOAuthPolicy() (*OAuthPolicy, error)
GetOAuthPolicy return the application OAuthPolicy
func (*Application) GetOAuthToken ¶
func (app *Application) GetOAuthToken(username string, password string) (*OAuthResponse, error)
GetOAuthToken creates a OAuth2 token response for a given user credentials
func (*Application) GetOAuthTokenStormpathGrantType ¶
func (app *Application) GetOAuthTokenStormpathGrantType(token string) (*OAuthResponse, error)
func (*Application) HandleCallback ¶
func (app *Application) HandleCallback(URL string) (*CallbackResult, error)
HandleCallback handles the URL from an ID Site callback or SAML callback it parses the JWT token validates it and return an CallbackResult with the token info + the Account if the sub was given
func (*Application) Purge ¶
func (app *Application) Purge() error
Purge deletes all the account stores before deleting the application
See: http://docs.stormpath.com/rest/product-guide/#delete-an-application
func (*Application) Refresh ¶
func (app *Application) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Application) RefreshOAuthToken ¶
func (app *Application) RefreshOAuthToken(refreshToken string) (*OAuthResponse, error)
RefreshOAuthToken refreshes an OAuth2 token using the provided refresh_token and returns a new OAuth reponse
func (*Application) RegisterAccount ¶
func (app *Application) RegisterAccount(account *Account) error
RegisterAccount registers a new account into the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Application) RegisterSocialAccount ¶
func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the application using an external provider Google, Facebook
func (*Application) ResendVerificationEmail ¶
func (app *Application) ResendVerificationEmail(email string) error
ResendVerificationEmail resends the verification email to the given email address
func (*Application) ResetPassword ¶
func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
ResetPassword resets a user password based on the reset token
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
func (*Application) SendPasswordResetEmail ¶
func (app *Application) SendPasswordResetEmail(email string) (*AccountPasswordResetToken, error)
SendPasswordResetEmail sends a password reset email to the given user
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
func (*Application) Update ¶
func (app *Application) Update() error
Update updates the given resource, by doing a POST to the resource Href
func (*Application) ValidatePasswordResetToken ¶
func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
ValidatePasswordResetToken validates a password reset token
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
func (*Application) ValidateToken ¶
func (app *Application) ValidateToken(token string) (*OAuthToken, error)
ValidateToken against the application
type ApplicationCriteria ¶
type ApplicationCriteria struct {
// contains filtered or unexported fields
}
func MakeApplicationCriteria ¶
func MakeApplicationCriteria() ApplicationCriteria
func MakeApplicationsCriteria ¶
func MakeApplicationsCriteria() ApplicationCriteria
func (ApplicationCriteria) DescriptionEq ¶
func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
func (ApplicationCriteria) NameEq ¶
func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
func (ApplicationCriteria) StatusEq ¶
func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
func (ApplicationCriteria) ToQueryString ¶
func (c ApplicationCriteria) ToQueryString() string
func (ApplicationCriteria) WithAccessTokens ¶
func (c ApplicationCriteria) WithAccessTokens(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithAccountStoreMappings ¶
func (c ApplicationCriteria) WithAccountStoreMappings(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithAccounts ¶
func (c ApplicationCriteria) WithAccounts(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithCustomData ¶
func (c ApplicationCriteria) WithCustomData() ApplicationCriteria
func (ApplicationCriteria) WithDefaultAccountStoreMapping ¶
func (c ApplicationCriteria) WithDefaultAccountStoreMapping() ApplicationCriteria
func (ApplicationCriteria) WithDefaultGroupStoreMapping ¶
func (c ApplicationCriteria) WithDefaultGroupStoreMapping() ApplicationCriteria
func (ApplicationCriteria) WithGroups ¶
func (c ApplicationCriteria) WithGroups(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithRefreshTokens ¶
func (c ApplicationCriteria) WithRefreshTokens(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithTenant ¶
func (c ApplicationCriteria) WithTenant() ApplicationCriteria
type Applications ¶
type Applications struct { Items []Application `json:"items,omitempty"` // contains filtered or unexported fields }
Applications represents a paged result or applications
func (Applications) IsCacheable ¶
func (r Applications) IsCacheable() bool
type AuthResult ¶
type AuthResult interface {
GetAccount() *Account
}
type AuthenticationResult ¶
type AuthenticationResult struct {
Account *Account
}
AuthenticationResult base authentication result for all authenticators
func (*AuthenticationResult) GetAccount ¶
func (ar *AuthenticationResult) GetAccount() *Account
type Authenticator ¶
type Authenticator struct {
Application *Application
}
Authenticator is the base authenticator type
See https://github.com/stormpath/stormpath-sdk-spec/blob/master/specifications/authenticators.md
type BasicAuthenticator ¶
type BasicAuthenticator Authenticator
BasicAuthenticator will authenticate the API Key and Secret of a Stormpath Account object. Authentication should succeed only if the following are true:
* The provided API Key and Secret exist for an account that is reachable by the application. * The API Key is not disabled. * The Account is not disabled.
func NewBasicAuthenticator ¶
func NewBasicAuthenticator(application *Application) BasicAuthenticator
NewBasicAuthenticator returns a BasicAuthenticator for the given application
func (BasicAuthenticator) Authenticate ¶
func (a BasicAuthenticator) Authenticate(accountAPIKey, accountAPISecret string) (*AuthenticationResult, error)
Authenticate authenticates the given account APIKey and APISecret
type Cache ¶
type Cache interface { Exists(key string) bool Set(key string, data []byte) Get(key string) []byte Del(key string) }
Cache is a base interface for any cache provider
type Cacheable ¶
type Cacheable interface {
IsCacheable() bool
}
Cacheable determines if the implementor should be cached or not
type CallbackResult ¶
CallbackResult holds the ID Site callback parsed JWT token information + the acccount if one was given
type Claims ¶
type Claims struct { EXP int64 `json:"exp"` IAT int64 `json:"iat"` ISS string `json:"iss"` JTI string `json:"jti"` RTI string `json:"rti"` SUB string `json:"sub"` }
Claims represents the expanded JWT claims
type Client ¶
type Client struct { ClientConfiguration ClientConfiguration HTTPClient *http.Client Cache Cache WebSDKToken string }
Client is low level REST client for any Stormpath request, it holds the credentials, an the actual http client, and the cache. The Cache can be initialize in nil and the client would simply ignore it and don't cache any response.
type ClientConfiguration ¶
type ClientConfiguration struct { APIKeyFile string APIKeyID string APIKeySecret string CacheManagerEnabled bool CacheTTL time.Duration CacheTTI time.Duration BaseURL string ConnectionTimeout int AuthenticationScheme string ProxyPort int ProxyHost string ProxyUsername string ProxyPassword string }
ClientConfiguration representd the overall SDK configuration options
func LoadConfiguration ¶
func LoadConfiguration() (ClientConfiguration, error)
LoadConfiguration loads the configuration from the default locations
func LoadConfigurationWithCreds ¶
func LoadConfigurationWithCreds(key string, secret string) ClientConfiguration
func (ClientConfiguration) GetJWTSigningKey ¶
func (config ClientConfiguration) GetJWTSigningKey() []byte
GetJWTSigningKey returns the API Key Secret as a []byte to sign JWT tokens
type CustomData ¶
type CustomData map[string]interface{}
CustomData represents Stormpath's custom data resouce
func (CustomData) IsCacheable ¶
func (customData CustomData) IsCacheable() bool
type Directories ¶
type Directories struct { Items []Directory `json:"items,omitempty"` // contains filtered or unexported fields }
Directories represnets a paged result of directories
func (Directories) IsCacheable ¶
func (r Directories) IsCacheable() bool
type Directory ¶
type Directory struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` Provider *Provider `json:"provider,omitempty"` AccountCreationPolicy *AccountCreationPolicy `json:"accountCreationPolicy,omitempty"` PasswordPolicy *PasswordPolicy `json:"passwordPolicy,omitempty"` // contains filtered or unexported fields }
Directory represents a Stormpath directory object
See: http://docs.stormpath.com/rest/product-guide/#directories
func GetDirectory ¶
GetDirectory loads a directory by href and criteria
func NewDirectory ¶
NewDirectory creates a new directory with the given name
func NewFacebookDirectory ¶
NewFacebookDirectory creates a new directory with a Facebook backed provider
func NewGithubDirectory ¶
NewGithubDirectory creates a new directory with a GitHub backed provider
func NewGoogleDirectory ¶
func NewGoogleDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
NewGoogleDirectory creates a new directory with a Google backed provider
func NewLinkedInDirectory ¶
func NewLinkedInDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
NewLinkedInDirectory creates a new directory with a LinkedIn backend provider
func (*Directory) CreateGroup ¶
CreateGroup creates a new group in the directory
func (*Directory) GetAccountCreationPolicy ¶
func (dir *Directory) GetAccountCreationPolicy() (*AccountCreationPolicy, error)
GetAccountCreationPolicy loads the directory account creation policy
func (*Directory) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Directory) Refresh ¶
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Directory) RegisterAccount ¶
RegisterAccount registers a new account into the directory
See: http://docs.stormpath.com/rest/product-guide/#directory-accounts
func (*Directory) RegisterSocialAccount ¶
func (dir *Directory) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the application using an external provider Google, Facebook
type DirectoryCriteria ¶
type DirectoryCriteria struct {
// contains filtered or unexported fields
}
func MakeDirectoriesCriteria ¶
func MakeDirectoriesCriteria() DirectoryCriteria
func MakeDirectoryCriteria ¶
func MakeDirectoryCriteria() DirectoryCriteria
func (DirectoryCriteria) DescriptionEq ¶
func (c DirectoryCriteria) DescriptionEq(description string) DirectoryCriteria
func (DirectoryCriteria) NameEq ¶
func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
func (DirectoryCriteria) StatusEq ¶
func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
func (DirectoryCriteria) ToQueryString ¶
func (c DirectoryCriteria) ToQueryString() string
func (DirectoryCriteria) WithAccountCreationPolicy ¶
func (c DirectoryCriteria) WithAccountCreationPolicy() DirectoryCriteria
func (DirectoryCriteria) WithAccounts ¶
func (c DirectoryCriteria) WithAccounts(pageRequest PageRequest) DirectoryCriteria
func (DirectoryCriteria) WithCustomData ¶
func (c DirectoryCriteria) WithCustomData() DirectoryCriteria
func (DirectoryCriteria) WithGroups ¶
func (c DirectoryCriteria) WithGroups(pageRequest PageRequest) DirectoryCriteria
func (DirectoryCriteria) WithPasswordPolicy ¶
func (c DirectoryCriteria) WithPasswordPolicy() DirectoryCriteria
func (DirectoryCriteria) WithProvider ¶
func (c DirectoryCriteria) WithProvider() DirectoryCriteria
func (DirectoryCriteria) WithTenant ¶
func (c DirectoryCriteria) WithTenant() DirectoryCriteria
type EmailTemplate ¶
type EmailTemplate struct { FromEmailAddress string `json:"fromEmailAddress"` FromName string `json:"fromName"` Subject string `json:"subject"` HTMLBody string `json:"htmlBody"` TextBody string `json:"textBody"` MimeType string `json:"mimeType"` DefaultModel map[string]string `json:"defaultModel"` // contains filtered or unexported fields }
EmailTemplate represents an account creation policy email template
func GetEmailTemplate ¶
func GetEmailTemplate(href string) (*EmailTemplate, error)
GetEmailTemplate loads an email template by href
func (*EmailTemplate) Delete ¶
func (r *EmailTemplate) Delete() error
Delete deletes the given account, it wont modify the calling account
func (EmailTemplate) IsCacheable ¶
func (r EmailTemplate) IsCacheable() bool
func (*EmailTemplate) Refresh ¶
func (template *EmailTemplate) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*EmailTemplate) Update ¶
func (template *EmailTemplate) Update() error
Update updates the given resource, by doing a POST to the resource Href
type EmailTemplates ¶
type EmailTemplates struct { Items []EmailTemplate `json:"items,omitempty"` // contains filtered or unexported fields }
EmailTemplates represents a collection of EmailTemplate
func (EmailTemplates) IsCacheable ¶
func (r EmailTemplates) IsCacheable() bool
type Error ¶
type Error struct { RequestID string Status int `json:"status"` Code int `json:"code"` Message string `json:"message"` DeveloperMessage string `json:"developerMessage"` MoreInfo string `json:"moreInfo"` OAuth2Error string `json:"error"` }
Error maps a Stormpath API JSON error object which implements Go error interface
type ExpandedJWT ¶
type ExpandedJWT struct { Claims Claims `json:"claims"` Header Header `json:"header"` Signature string `json:"signature"` }
ExpandedJWT represents the OAuth token expanded JWT information
type GrantTypeClientCredentialsTokenClaims ¶
type GrantTypeClientCredentialsTokenClaims struct { jwt.StandardClaims Scope string `json:"scope,omitempty"` }
GrantTypeClientCredentialsTokenClaims are the JWT claims use for the client credentials OAuth2 grant type authentication
type GrantTypeStormpathTokenClaims ¶
type GrantTypeStormpathTokenClaims struct { jwt.StandardClaims Status string `json:"status,omitempty"` }
GrantTypeStormpathTokenClaims are the JWT claims for a Stormpath OAuth2 authentication using the stormpath_token grant type
type Group ¶
type Group struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` Directory *Directory `json:"directory,omitempty"` AccountMemberships *GroupMemberships `json:"accountMemberships,omitempty"` // contains filtered or unexported fields }
Group represents a Stormpath Group
See: http://docs.stormpath.com/rest/product-guide/#groups
func (*Group) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Group) GetGroupAccountMemberships ¶
func (group *Group) GetGroupAccountMemberships(criteria Criteria) (*GroupMemberships, error)
GetGroupAccountMemberships loads the given group memeberships
type GroupCriteria ¶
type GroupCriteria struct {
// contains filtered or unexported fields
}
func MakeGroupCriteria ¶
func MakeGroupCriteria() GroupCriteria
func MakeGroupMemershipsCriteria ¶
func MakeGroupMemershipsCriteria() GroupCriteria
func MakeGroupsCriteria ¶
func MakeGroupsCriteria() GroupCriteria
func (GroupCriteria) DescriptionEq ¶
func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
func (GroupCriteria) NameEq ¶
func (c GroupCriteria) NameEq(name string) GroupCriteria
func (GroupCriteria) StatusEq ¶
func (c GroupCriteria) StatusEq(status string) GroupCriteria
func (GroupCriteria) ToQueryString ¶
func (c GroupCriteria) ToQueryString() string
func (GroupCriteria) WithAccounts ¶
func (c GroupCriteria) WithAccounts(pageRequest PageRequest) GroupCriteria
func (GroupCriteria) WithCustomData ¶
func (c GroupCriteria) WithCustomData() GroupCriteria
func (GroupCriteria) WithDirectory ¶
func (c GroupCriteria) WithDirectory() GroupCriteria
func (GroupCriteria) WithTenant ¶
func (c GroupCriteria) WithTenant() GroupCriteria
type GroupMembership ¶
type GroupMembership struct { Account *Account `json:"account"` Group *Group `json:"group"` // contains filtered or unexported fields }
func NewGroupMembership ¶
func NewGroupMembership(accountHref string, groupHref string) *GroupMembership
func (*GroupMembership) Delete ¶
func (r *GroupMembership) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*GroupMembership) GetAccount ¶
func (groupmembership *GroupMembership) GetAccount(criteria Criteria) (*Account, error)
func (*GroupMembership) GetGroup ¶
func (groupmembership *GroupMembership) GetGroup(criteria Criteria) (*Group, error)
func (GroupMembership) IsCacheable ¶
func (r GroupMembership) IsCacheable() bool
type GroupMembershipCriteria ¶
type GroupMembershipCriteria struct {
// contains filtered or unexported fields
}
func MakeGroupMemershipCriteria ¶
func MakeGroupMemershipCriteria() GroupMembershipCriteria
func (GroupMembershipCriteria) ToQueryString ¶
func (c GroupMembershipCriteria) ToQueryString() string
func (GroupMembershipCriteria) WithAccount ¶
func (c GroupMembershipCriteria) WithAccount() GroupMembershipCriteria
func (GroupMembershipCriteria) WithGroup ¶
func (c GroupMembershipCriteria) WithGroup() GroupMembershipCriteria
type GroupMemberships ¶
type GroupMemberships struct { Items []GroupMembership `json:"items,omitempty"` // contains filtered or unexported fields }
func (GroupMemberships) IsCacheable ¶
func (r GroupMemberships) IsCacheable() bool
type Groups ¶
type Groups struct { Items []Group `json:"items,omitempty"` // contains filtered or unexported fields }
Groups represent a paged result of groups
func (Groups) IsCacheable ¶
func (r Groups) IsCacheable() bool
type IDSiteAssertionTokenClaims ¶
type IDSiteAssertionTokenClaims struct { jwt.StandardClaims State string `json:"state,omitempty"` Status string `json:"status,omitempty"` }
IDSiteAssertionTokenClaims are the JWT claims of an Stormpath Assertion type authentication this could originage from an IDSite workflow
type IDSiteOptions ¶
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
func NewLocalCache ¶
func NewLocalCache(ttl time.Duration, tti time.Duration) *LocalCache
func (*LocalCache) Count ¶
func (cache *LocalCache) Count() int
Count returns the number of items in the cache (helpful for tracking memory leaks)
func (*LocalCache) Del ¶
func (cache *LocalCache) Del(key string)
func (*LocalCache) Exists ¶
func (cache *LocalCache) Exists(key string) bool
func (*LocalCache) Get ¶
func (cache *LocalCache) Get(key string) []byte
func (*LocalCache) Set ¶
func (cache *LocalCache) Set(key string, data []byte)
type OAuthAccessTokenResult ¶
type OAuthAccessTokenResult OAuthResponse
func (*OAuthAccessTokenResult) GetAccount ¶
func (ar *OAuthAccessTokenResult) GetAccount() *Account
type OAuthBearerAuthenticator ¶
type OAuthBearerAuthenticator Authenticator
OAuthBearerAuthenticator should authenticate OAuth2 bearer tokens only. The token is an access token JWT that has been created by Stormpath. The token may have been created by the client_credential or password_grant flow. This can be determined by looking at the kid property in the header of the JWT. Password grant JWTs will have a kid, but client credential JWTs will not.
func NewOAuthBearerAuthenticator ¶
func NewOAuthBearerAuthenticator(application *Application) OAuthBearerAuthenticator
func (OAuthBearerAuthenticator) Authenticate ¶
func (a OAuthBearerAuthenticator) Authenticate(accessTokenJWT string) (*AuthenticationResult, error)
type OAuthClientCredentialsAuthenticationResult ¶
type OAuthClientCredentialsAuthenticationResult OAuthResponse
func (*OAuthClientCredentialsAuthenticationResult) GetAccount ¶
func (ar *OAuthClientCredentialsAuthenticationResult) GetAccount() *Account
type OAuthClientCredentialsAuthenticator ¶
type OAuthClientCredentialsAuthenticator struct { Authenticator ScopeFactory ScopeFactoryFunc TTL time.Duration }
OAuthClientCredentialsAuthenticator this authenticator accepts an Account's API Key and Secret, and gives back an access token in response. The authenticator should follow the same authentication rules as the BasicAuthenticator. The end-user (account) can request scope, if the scope factory determines that this scope is permitted, then the scope should be added to the access token.
This authenticator is responsible for creating the access token. The Stormpath REST API does not yet provide the client_credential grant on the appplication's /oauth/token endpoint.
func NewOAuthClientCredentialsAuthenticator ¶
func NewOAuthClientCredentialsAuthenticator(application *Application) OAuthClientCredentialsAuthenticator
func (OAuthClientCredentialsAuthenticator) Authenticate ¶
func (a OAuthClientCredentialsAuthenticator) Authenticate(accountAPIKeyID, accountAPIKeySecret, scope string) (*OAuthClientCredentialsAuthenticationResult, error)
type OAuthPasswordAuthenticator ¶
type OAuthPasswordAuthenticator Authenticator
OAuthPasswordAuthenticator this authenticator accepts an account's username and password, and returns an access token response that is obtained by posting the username and password to the application's /oauth/token endpoint with the grant_type=password parameter.
func NewOAuthPasswordAuthenticator ¶
func NewOAuthPasswordAuthenticator(application *Application) OAuthPasswordAuthenticator
func (OAuthPasswordAuthenticator) Authenticate ¶
func (a OAuthPasswordAuthenticator) Authenticate(username, password string) (*OAuthAccessTokenResult, error)
type OAuthPolicy ¶
type OAuthPolicy struct { AccessTokenTTL string `json:"accessTokenTtl,omitempty"` RefreshTokenTTL string `json:"refreshTokenTtl,omitempty"` // contains filtered or unexported fields }
OAuthPolicy holds the application related OAuth configuration
func (*OAuthPolicy) Delete ¶
func (r *OAuthPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (OAuthPolicy) IsCacheable ¶
func (r OAuthPolicy) IsCacheable() bool
type OAuthProvider ¶
type OAuthProvider struct { ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` RedirectURI string `json:"redirectUri,omitempty"` }
OAuthProvider represents a generic OAuth2 provider for all the social type directories
type OAuthRefreshTokenAuthenticator ¶
type OAuthRefreshTokenAuthenticator Authenticator
OAuthRefreshTokenAuthenticator this authenticator accepts a previously-issued refresh token and post's it to the application's /oauth/token endpoint with the grant_type=refresh_token parameter. The response is a new access token response.
func NewOAuthRefreshTokenAuthenticator ¶
func NewOAuthRefreshTokenAuthenticator(application *Application) OAuthRefreshTokenAuthenticator
func (OAuthRefreshTokenAuthenticator) Authenticate ¶
func (a OAuthRefreshTokenAuthenticator) Authenticate(refreshToken string) (*OAuthAccessTokenResult, error)
type OAuthRequestAuthenticator ¶
type OAuthRequestAuthenticator struct { Authenticator ScopeFactory ScopeFactoryFunc TTL time.Duration }
OAuthRequestAuthenticator should authenticate OAuth2 requests. It will eventually support authenticating all 4 OAuth2 grant types.
Specifically, right now, this class will authenticate OAuth2 access tokens, as well as handle API key for access token exchanges using the OAuth2 client credentials grant type.
func NewOAuthRequestAuthenticator ¶
func NewOAuthRequestAuthenticator(application *Application) OAuthRequestAuthenticator
func (OAuthRequestAuthenticator) Authenticate ¶
func (a OAuthRequestAuthenticator) Authenticate(r *http.Request) (*OAuthAccessTokenResult, error)
type OAuthResponse ¶
type OAuthResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token,omitempty"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` StormpathAccessTokenHref string `json:"stormpath_access_token_href,omitempty"` }
OAuthResponse represents an OAuth2 response from StormPath
type OAuthStormpathTokenAuthenticator ¶
type OAuthStormpathTokenAuthenticator Authenticator
OAuthStormpathTokenAuthenticator this authenticator takes a Stormpath Token JWT and posts it to the application's /oauth/token endpoint, as grant_type=stormpath_token. The result is an OAuthAccessTokenResult.
func NewOAuthStormpathTokenAuthenticator ¶
func NewOAuthStormpathTokenAuthenticator(application *Application) OAuthStormpathTokenAuthenticator
func (OAuthStormpathTokenAuthenticator) Authenticate ¶
func (a OAuthStormpathTokenAuthenticator) Authenticate(stormpathJWT string) (*OAuthAccessTokenResult, error)
type OAuthToken ¶
type OAuthToken struct { Account *Account `json:"account"` Application *Application `json:"application"` Tenant *Tenant `json:"tenant"` JWT string `json:"jwt"` ExpandedJWT ExpandedJWT `json:"expandedJwt"` // contains filtered or unexported fields }
OAuthToken represents the Stormpath OAuthToken see: https://docs.stormpath.com/guides/token-management/
func (OAuthToken) IsCacheable ¶
func (r OAuthToken) IsCacheable() bool
type OAuthTokenCriteria ¶
type OAuthTokenCriteria struct {
// contains filtered or unexported fields
}
func MakeOAuthTokensCriteria ¶
func MakeOAuthTokensCriteria() OAuthTokenCriteria
func (OAuthTokenCriteria) ToQueryString ¶
func (c OAuthTokenCriteria) ToQueryString() string
type OAuthTokens ¶
type OAuthTokens struct { Items []OAuthToken `json:"items,omitempty"` // contains filtered or unexported fields }
OAuthTokens collection type for OAuthToken
func (OAuthTokens) IsCacheable ¶
func (r OAuthTokens) IsCacheable() bool
type PageRequest ¶
PageRequest contains the limit and offset values for any paginated Stormpath request
type PasswordPolicy ¶
type PasswordPolicy struct { ResetTokenTTL int `json:"resetTokenTtl,omitempty"` ResetEmailStatus string `json:"resetEmailStatus,omitempty"` ResetSuccessEmailStatus string `json:"resetSuccessEmailStatus,omitempty"` ResetEmailTemplates *EmailTemplates `json:"resetEmailTemplates,omitempty"` ResetSuccessEmailTemplates *EmailTemplates `json:"resetSuccessEmailTemplates,omitempty"` // contains filtered or unexported fields }
func (*PasswordPolicy) Delete ¶
func (r *PasswordPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*PasswordPolicy) GetResetEmailTemplates ¶
func (policy *PasswordPolicy) GetResetEmailTemplates() (*EmailTemplates, error)
GetResetEmailTemplates loads the policy ResetEmailTemplates collection and returns it
func (*PasswordPolicy) GetResetSuccessEmailTemplates ¶
func (policy *PasswordPolicy) GetResetSuccessEmailTemplates() (*EmailTemplates, error)
GetResetSuccessEmailTemplates loads the policy ResetSuccessEmailTemplates collection and returns it
func (PasswordPolicy) IsCacheable ¶
func (r PasswordPolicy) IsCacheable() bool
func (*PasswordPolicy) Refresh ¶
func (policy *PasswordPolicy) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*PasswordPolicy) Update ¶
func (policy *PasswordPolicy) Update() error
Update updates the given resource, by doing a POST to the resource Href
type Provider ¶
type Provider struct { OAuthProvider ProviderID string `json:"providerId,omitempty"` // contains filtered or unexported fields }
Provider represents the directory provider (cloud, google, github, facebook or linkedin)
func (*Provider) Delete ¶
func (r *Provider) Delete() error
Delete deletes the given account, it wont modify the calling account
func (Provider) IsCacheable ¶
func (r Provider) IsCacheable() bool
type ProviderData ¶
type ProviderData struct { ProviderID string `json:"providerId"` AccessToken string `json:"accessToken,omitempty"` Code string `json:"code,omitempty"` }
ProviderData represents the especific information needed by the social provider (Google, Github, Faceboo, etc)
type SAMLAssertionTokenClaims ¶
type SAMLAssertionTokenClaims struct { jwt.StandardClaims State string `json:"state,omitempty"` Status string `json:"status,omitempty"` IsNewSub string `json:"isNewSub,omitempty"` IRT string `json:"irt,omitempty"` }
SAMLAssertionTokenClaims are the JWT claims of an Stormpath Assertion type authentication this could originage from an SAML workflow
type SAMLAuthenticationTokenClaims ¶
type SAMLAuthenticationTokenClaims struct { jwt.StandardClaims CallbackURI string `json:"cb_uri,omitempty"` State string `json:"state,omitempty"` ASH string `json:"ash,omitempty"` ONK string `json:"onk,omitempty"` }
SAMLAuthenticationTokenClaims are the JWT claims needed to start a Stormpath SAML workflow
type SSOTokenClaims ¶
type SSOTokenClaims struct { jwt.StandardClaims CallbackURI string `json:"cb_uri,omitempty"` Path string `json:"path,omitempty"` State string `json:"state,omitempty"` OrganizationNameKey string `json:"organizationNameKey,omitempty"` ShowOrganiztaionField bool `json:"showOrganiztaionField,omitempty"` }
SSOTokenClaims are the JWT for initiating an IDSite workflow
type ScopeFactoryFunc ¶
type SocialAccount ¶
type SocialAccount struct {
Data ProviderData `json:"providerData"`
}
SocialAccount represents the JSON payload use to create an account for a social backend directory (Google, Facebook, Github, etc)
type StormpathAssertionAuthenticationResult ¶
type StormpathAssertionAuthenticationResult CallbackResult
func (*StormpathAssertionAuthenticationResult) GetAccount ¶
func (ar *StormpathAssertionAuthenticationResult) GetAccount() *Account
type StormpathAssertionAuthenticator ¶
type StormpathAssertionAuthenticator Authenticator
StormpathAssertionAuthenticator this authenticator will verify the a JWT from an ID Site or SAML callback. It should verify that:
* The token is not expired * The signature can be verified * The claims body does not contain an err property.
func NewStormpathAssertionAuthenticator ¶
func NewStormpathAssertionAuthenticator(application *Application) StormpathAssertionAuthenticator
func (StormpathAssertionAuthenticator) Authenticate ¶
func (a StormpathAssertionAuthenticator) Authenticate(stormpathJWT string) (*StormpathAssertionAuthenticationResult, error)
type Tenant ¶
type Tenant struct { Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` Applications *Applications `json:"applications,omitempty"` Directories *Directories `json:"directories,omitempty"` // contains filtered or unexported fields }
Tenant represents a Stormpath tennat see http://docs.stormpath.com/rest/product-guide/#tenants
func CurrentTenant ¶
CurrentTenant returns the current tenant see http://docs.stormpath.com/rest/product-guide/#retrieve-the-current-tenant
func (*Tenant) CreateApplication ¶
func (tenant *Tenant) CreateApplication(app *Application) error
CreateApplication creates a new application for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-applications
func (*Tenant) CreateDirectory ¶
CreateDirectory creates a new directory for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-directories
func (*Tenant) DeleteCustomData ¶
func (r *Tenant) DeleteCustomData() error
DeleteCustomData deletes all the resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Tenant) GetApplications ¶
func (tenant *Tenant) GetApplications(criteria Criteria) (*Applications, error)
GetApplications returns all the applications for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-applications
func (*Tenant) GetCustomData ¶
func (r *Tenant) GetCustomData() (CustomData, error)
GetCustomData returns the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Tenant) GetDirectories ¶
func (tenant *Tenant) GetDirectories(criteria Criteria) (*Directories, error)
GetDirectories returns all the directories for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-directories
func (*Tenant) UpdateCustomData ¶
func (r *Tenant) UpdateCustomData(customData CustomData) (CustomData, error)
UpdateCustomData sets or updates the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
Source Files ¶
- account.go
- account_creation_policy.go
- account_criteria.go
- account_store_mapping.go
- account_store_mapping_criteria.go
- api_keys.go
- application.go
- application_criteria.go
- authenticators.go
- cache.go
- config.go
- credentials.go
- criteria.go
- custom_data.go
- directory.go
- directory_criteria.go
- email_template.go
- error.go
- group.go
- group_criteria.go
- group_membership.go
- group_membership_criteria.go
- jwt.go
- local_cache.go
- logger.go
- oauth_policy.go
- oauth_token.go
- page_request.go
- password_policy.go
- resources.go
- sauthc1.go
- stormpath.go
- tenant.go