package fake
import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/fake"
Index ¶
- type AccessTokens
- func (f *AccessTokens) DeviceCodeResult(ctx context.Context, authParameters authority.AuthParams) (accesstokens.DeviceCodeResult, error)
- func (f *AccessTokens) FromAssertion(ctx context.Context, authParameters authority.AuthParams, assertion string) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromAuthCode(ctx context.Context, req accesstokens.AuthCodeRequest) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromClientSecret(ctx context.Context, authParameters authority.AuthParams, clientSecret string) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromDeviceCodeResult(ctx context.Context, authParameters authority.AuthParams, deviceCodeResult accesstokens.DeviceCodeResult) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromRefreshToken(ctx context.Context, appType accesstokens.AppType, authParams authority.AuthParams, cc *accesstokens.Credential, refreshToken string) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromSamlGrant(ctx context.Context, authParameters authority.AuthParams, samlGrant wstrust.SamlTokenInfo) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromUserAssertionClientCertificate(ctx context.Context, authParameters authority.AuthParams, userAssertion, assertion string) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromUserAssertionClientSecret(ctx context.Context, authParameters authority.AuthParams, userAssertion, clientSecret string) (accesstokens.TokenResponse, error)
- func (f *AccessTokens) FromUsernamePassword(ctx context.Context, authParameters authority.AuthParams) (accesstokens.TokenResponse, error)
- type Authority
- func (f Authority) AADInstanceDiscovery(ctx context.Context, info authority.Info) (authority.InstanceDiscoveryResponse, error)
- func (f Authority) UserRealm(ctx context.Context, params authority.AuthParams) (authority.UserRealm, error)
- type ResolveEndpoints
- type WSTrust
Types ¶
type AccessTokens ¶
type AccessTokens struct {
// Set this to true to have all APIs return an error.
Err bool
// Result is for use with FromDeviceCodeResult. On each call it returns
// the next item in this slice. They must be either an error or nil.
Result []error
Next int
// fake result to return
AccessToken accesstokens.TokenResponse
// fake result to return
DeviceCode accesstokens.DeviceCodeResult
// FromRefreshTokenCallback is an optional callback invoked by FromRefreshToken
FromRefreshTokenCallback func(appType accesstokens.AppType, authParams authority.AuthParams, cc *accesstokens.Credential, refreshToken string)
// ValidateAssertion is an optional callback for validating an assertion generated by confidential.Client
ValidateAssertion func(string)
}
AccessTokens is a fake implementation of the oauth.accessTokens interface.
func (*AccessTokens) DeviceCodeResult ¶
func (f *AccessTokens) DeviceCodeResult(ctx context.Context, authParameters authority.AuthParams) (accesstokens.DeviceCodeResult, error)
func (*AccessTokens) FromAssertion ¶
func (f *AccessTokens) FromAssertion(ctx context.Context, authParameters authority.AuthParams, assertion string) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromAuthCode ¶
func (f *AccessTokens) FromAuthCode(ctx context.Context, req accesstokens.AuthCodeRequest) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromClientSecret ¶
func (f *AccessTokens) FromClientSecret(ctx context.Context, authParameters authority.AuthParams, clientSecret string) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromDeviceCodeResult ¶
func (f *AccessTokens) FromDeviceCodeResult(ctx context.Context, authParameters authority.AuthParams, deviceCodeResult accesstokens.DeviceCodeResult) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromRefreshToken ¶
func (f *AccessTokens) FromRefreshToken(ctx context.Context, appType accesstokens.AppType, authParams authority.AuthParams, cc *accesstokens.Credential, refreshToken string) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromSamlGrant ¶
func (f *AccessTokens) FromSamlGrant(ctx context.Context, authParameters authority.AuthParams, samlGrant wstrust.SamlTokenInfo) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromUserAssertionClientCertificate ¶
func (f *AccessTokens) FromUserAssertionClientCertificate(ctx context.Context, authParameters authority.AuthParams, userAssertion, assertion string) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromUserAssertionClientSecret ¶
func (f *AccessTokens) FromUserAssertionClientSecret(ctx context.Context, authParameters authority.AuthParams, userAssertion, clientSecret string) (accesstokens.TokenResponse, error)
func (*AccessTokens) FromUsernamePassword ¶
func (f *AccessTokens) FromUsernamePassword(ctx context.Context, authParameters authority.AuthParams) (accesstokens.TokenResponse, error)
type Authority ¶
type Authority struct {
// Set this to true to have all APIs return an error.
Err bool
// The fake UserRealm to return from the UserRealm() API.
Realm authority.UserRealm
// fake result to return
InstanceResp authority.InstanceDiscoveryResponse
}
Authority is a fake implementation of the oauth.fetchAuthority interface.
func (Authority) AADInstanceDiscovery ¶
func (f Authority) AADInstanceDiscovery(ctx context.Context, info authority.Info) (authority.InstanceDiscoveryResponse, error)
func (Authority) UserRealm ¶
func (f Authority) UserRealm(ctx context.Context, params authority.AuthParams) (authority.UserRealm, error)
type ResolveEndpoints ¶
type ResolveEndpoints struct {
// Set this to true to have all APIs return an error.
Err bool
// fake result to return
Endpoints authority.Endpoints
}
ResolveEndpoints is a fake implementation of the oauth.resolveEndpointer interface.
func (ResolveEndpoints) ResolveEndpoints ¶
func (f ResolveEndpoints) ResolveEndpoints(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, error)
type WSTrust ¶
type WSTrust struct {
// Set these to true to have their respective APIs return an error.
GetMexErr, GetSAMLTokenInfoErr bool
// fake result to return
MexDocument defs.MexDocument
// fake result to return
SamlTokenInfo wstrust.SamlTokenInfo
}
WSTrust is a fake implementation of the oauth.fetchWSTrust interface.
func (WSTrust) Mex ¶
func (WSTrust) SAMLTokenInfo ¶
func (f WSTrust) SAMLTokenInfo(ctx context.Context, authParameters authority.AuthParams, cloudAudienceURN string, endpoint defs.Endpoint) (wstrust.SamlTokenInfo, error)
Source Files ¶
- Version
- v1.6.0 (latest)
- Published
- Nov 5, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 months ago –
Tools for package owners.