Documentation
¶
Index ¶
- Constants
- func IsMobileUserAgent(userAgent string) bool
- type AuthRequest
- type AuthRequestRequirements
- type AuthResponse
- type BankIDAuthenticationRequest
- type BankIDAuthenticationResponse
- type BankIDConfig
- type BankIDEnvironment
- type BankIDProvider
- type BankIDRP
- func (b *BankIDRP) Cancel(orderRef string)
- func (b *BankIDRP) DoAuth(ar AuthRequest) *AuthResponse
- func (b *BankIDRP) DoCollection(orderRef string) *CollectResponse
- func (b *BankIDRP) DoPhoneAuth(par PhoneAuthRequest) *AuthResponse
- func (b *BankIDRP) GenerateLaunchURL(resp *AuthResponse, returnURL string, appLink bool) string
- func (b *BankIDRP) GenerateQRData(resp *AuthResponse) (qrCodeData []string)
- func (b *BankIDRP) GetAuthUrl() string
- func (b *BankIDRP) GetCancelUrl() string
- func (b *BankIDRP) GetCertPolicyString(policy CertificatePolicy) string
- func (b *BankIDRP) GetCollectUrl() string
- func (b *BankIDRP) GetPhoneAuthUrl() string
- type BankIDResponse
- type BankIDStatusResponse
- type BankIDTransaction
- type CallInitiator
- type CancelRequest
- type CardReaderClass
- type CertificatePolicy
- type CollectCompletionData
- type CollectRequest
- type CollectResponse
- type CollectStatus
- type CompletionDataDevice
- type CompletionDataStepUp
- type CompletionDataUser
- type HintCode
- type OrderRequest
- type PhoneAuthRequest
Constants ¶
View Source
const LATEST_VERSION = "6.0"
View Source
const SESSION_TIMEOUT = 30
Variables ¶
This section is empty.
Functions ¶
func IsMobileUserAgent ¶
Types ¶
type AuthRequest ¶
type AuthRequest struct {
EndUserIp string `json:"endUserIp"`
UserVisibleData string `json:"userVisibleData,omitempty"`
UserNonVisibleData string `json:"userNonVisibleData,omitempty"`
UserVisibleDataFormat string `json:"userVisibleDataFormat,omitempty"`
Requirement *AuthRequestRequirements `json:"requirement,omitempty"`
}
type AuthRequestRequirements ¶
type AuthRequestRequirements struct {
PinCode bool `json:"pinCode,omitempty"`
Mrtd bool `json:"mrtd,omitempty"`
CardReader CardReaderClass `json:"cardReader,omitempty"`
PersonalNumber string `json:"personalNumber,omitempty"`
CertificatePolicies []string `json:"certificatePolicies,omitempty"`
}
type AuthResponse ¶
type AuthResponse struct {
BankIDResponse
OrderRef string `json:"orderRef"`
AutoStartToken string `json:"autoStartToken"`
QrStartToken string `json:"qrStartToken"`
QrStartSecret string `json:"qrStartSecret"`
}
type BankIDConfig ¶
type BankIDConfig struct {
Env BankIDEnvironment `yaml:"env"`
Version string `yaml:"version"`
CertificateFolder string `yaml:"certificateFolder"`
Domain *string `yaml:"domain"`
VisibleMessage string `yaml:"visibleMessage"`
}
type BankIDEnvironment ¶
type BankIDEnvironment string
const ( PRODUCTION BankIDEnvironment = "prod" TEST BankIDEnvironment = "test" )
type BankIDProvider ¶
func NewBankIDProvider ¶
func NewBankIDProvider(config *BankIDConfig) *BankIDProvider
func (*BankIDProvider) Authenticate ¶
func (provider *BankIDProvider) Authenticate(request BankIDAuthenticationRequest) BankIDAuthenticationResponse
func (*BankIDProvider) Cancel ¶
func (provider *BankIDProvider) Cancel(transactionKey string)
func (*BankIDProvider) Status ¶
func (provider *BankIDProvider) Status(transactionKey string) BankIDStatusResponse
type BankIDRP ¶
type BankIDRP struct {
Client *http.Client
Config *BankIDConfig
}
func NewBankIDRP ¶
func NewBankIDRP(config *BankIDConfig) (*BankIDRP, error)
func (*BankIDRP) DoAuth ¶
func (b *BankIDRP) DoAuth(ar AuthRequest) *AuthResponse
func (*BankIDRP) DoCollection ¶
func (b *BankIDRP) DoCollection(orderRef string) *CollectResponse
func (*BankIDRP) DoPhoneAuth ¶
func (b *BankIDRP) DoPhoneAuth(par PhoneAuthRequest) *AuthResponse
func (*BankIDRP) GenerateLaunchURL ¶
func (b *BankIDRP) GenerateLaunchURL(resp *AuthResponse, returnURL string, appLink bool) string
func (*BankIDRP) GenerateQRData ¶
func (b *BankIDRP) GenerateQRData(resp *AuthResponse) (qrCodeData []string)
func (*BankIDRP) GetAuthUrl ¶
func (*BankIDRP) GetCancelUrl ¶
func (*BankIDRP) GetCertPolicyString ¶
func (b *BankIDRP) GetCertPolicyString(policy CertificatePolicy) string
func (*BankIDRP) GetCollectUrl ¶
func (*BankIDRP) GetPhoneAuthUrl ¶
type BankIDResponse ¶
type BankIDStatusResponse ¶
type BankIDStatusResponse struct {
Message string `json:"message"`
Status CollectStatus `json:"status"`
Data interface{} `json:"data,omitempty"`
}
type BankIDTransaction ¶
type CallInitiator ¶
type CallInitiator string
const ( UserCallInitiator CallInitiator = "user" RPCallInitiator CallInitiator = "RP" )
type CancelRequest ¶
type CancelRequest OrderRequest
type CardReaderClass ¶
type CardReaderClass string
const ( ComputerOrReader CardReaderClass = "class1" // default OnlyReader CardReaderClass = "class2" )
type CertificatePolicy ¶
type CertificatePolicy string
const ( OnFile CertificatePolicy = "1.2.752.78.1.1" SmartCard CertificatePolicy = "1.2.752.78.1.2" Mobile CertificatePolicy = "1.2.752.78.1.5" )
type CollectCompletionData ¶
type CollectCompletionData struct {
User CompletionDataUser `json:"user"`
Device CompletionDataDevice `json:"device"`
BankIdIssueDate string `json:"bankIdIssueDate"`
StepUp CompletionDataStepUp `json:"stepUp"`
Signature string `json:"signature"`
OcspResponse string `json:"ocspResponse"`
}
type CollectRequest ¶
type CollectRequest OrderRequest
type CollectResponse ¶
type CollectResponse struct {
BankIDResponse
CollectRequest
Status CollectStatus `json:"status"`
HintCode HintCode `json:"hintCode"`
CompletionData CollectCompletionData `json:"completionData"`
}
type CollectStatus ¶
type CollectStatus string
const ( PENDING CollectStatus = "pending" COMPLETE CollectStatus = "complete" FAILED CollectStatus = "failed" )
type CompletionDataDevice ¶
type CompletionDataStepUp ¶
type CompletionDataStepUp struct {
Mrtd bool `json:"mrtd"`
}
type CompletionDataUser ¶
type HintCode ¶
type HintCode string
const ( UNKNOWN HintCode = "unknown" OUTSTANDING_TRANSACTION HintCode = "outstandingTransaction" NO_CLIENT HintCode = "noClient" STARTED HintCode = "started" USER_MRTD HintCode = "userMrtd" USER_CALL_CONFRIRM HintCode = "userCallConfirm" USER_SIGN HintCode = "userSign" EXPIRED_TRANSACTION HintCode = "expiredTransaction" CERTIFICATE_ERR HintCode = "certificateErr" USER_CANCEL HintCode = "userCancel" CANCELLED HintCode = "cancelled" START_FAILED HintCode = "startFailed" USER_DECLINED_CALL HintCode = "userDeclinedCall" )
func (HintCode) GetMessage ¶
type OrderRequest ¶
type OrderRequest struct {
OrderRef string `json:"orderRef"`
}
type PhoneAuthRequest ¶
type PhoneAuthRequest struct {
PersonalNumber string `json:"personalNumber"`
CallInitiator CallInitiator `json:"callInitiator"`
UserVisibleData string `json:"userVisibleData,omitempty"`
UserNonVisibleData string `json:"userNonVisibleData,omitempty"`
UserVisibleDataFormat string `json:"userVisibleDataFormat,omitempty"`
Requirements *AuthRequestRequirements `json:"requirement,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.