Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartAuth ¶
func StartAuth(c *nordeago.Client, request AuthRequest) (string, error)
StartAuth returns a url to redirect the user to for Oauth flow?
TODO I am not sure how this differs as I do not have access to a production environment and can't test
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#startAuthentication
Types ¶
type AuthRequest ¶
type AuthRequest struct { Scope string `url:"scope,omitempty"` Language string `url:"language,omitempty"` RedirectURI string `url:"redirect_uri,omitempty"` Accounts []string `url:"accounts,omitempty"` Duration int64 `url:"duration,omitempty"` State string `url:"state,omitempty"` ClientID string `url:"client_id,omitempty"` MaxTxHistory string `url:"max_tx_history,omitempty"` UID string `url:"uid,omitempty"` // For sandbox only }
AuthRequest represents the data needed for the StartAuth function
type AuthRequestDecoupled ¶
type AuthRequestDecoupled struct { ResponseType string `json:"response_type"` // 'nordea_code' or 'nordea_token' both seem to work PsuID string `json:"psu_id"` Scope []string `json:"scope"` Language string `json:"language,omitempty"` RedirectURI string `json:"redirect_uri,omitempty"` AccountList []string `json:"account_list"` Duration int64 `json:"duration"` State string `json:"state,omitempty"` }
AuthRequestDecoupled represents the data needed for the StartAuthDecoupled function
type Response ¶
type Response struct { Code string `json:"code,omitempty"` OrderRef string `json:"order_ref,omitempty"` Status string `json:"status,omitempty"` TppToken string `json:"tpp_token,omitempty"` Links []nordeago.Link `json:"links,omitempty"` State string `json:"state,omitempty"` Accounts []ais.Account `json:"accounts,omitempty"` Scopes []string `json:"scopes,omitempty"` }
Response is part of the Result and can contain different data depending on the method that is called
func GetAssets ¶
GetAssets use an access token to get the assets or accounts of the authenticated user
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#getAssets
func PollForAuthCodeDecoupled ¶
PollForAuthCodeDecoupled polls for an auth code which will be returned when the user has accepted access to their accounts/payments based on scope. Warning: Decoupled Authorisation flow is a mock version, and it is only intended to show how the production version will work.
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#getToken
func StartAuthDecoupled ¶
func StartAuthDecoupled(c *nordeago.Client, request AuthRequestDecoupled) (*Response, error)
StartAuthDecoupled initiates authentication with the Nordea API which will allow us to make requests to the Accounts and Payments API. This initiates the user authentication. Warning: Decoupled Authorisation flow is a mock version, and it is only intended to show how the production version will work.
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#authorize
type RetrieveAccessTokenRequest ¶
type RetrieveAccessTokenRequest struct { GrantType string `json:"grant_type"` // TODO seems undocumented but exists in postman example Code string `json:"code"` RedirectURI string `json:"redirect_uri"` }
RetrieveAccessTokenRequest requires a valid code which is returned from PollForAuthCodeDecoupled
type RetrieveAccessTokenResponse ¶
type RetrieveAccessTokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` TokenType string `json:"token_type"` // Always BEARER }
RetrieveAccessTokenResponse represents the response returned from PollForAuthCodeDecoupled
func RetrieveAccessToken ¶
func RetrieveAccessToken(c *nordeago.Client, request RetrieveAccessTokenRequest) (RetrieveAccessTokenResponse, error)
RetrieveAccessToken returns a bearer token to use for the Accounts and Payments API requests.
TODO I am not sure how this differs as I do not have access to a production environment and can't test
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#accessToken
func RetrieveAccessTokenDecoupled ¶
func RetrieveAccessTokenDecoupled(c *nordeago.Client, request RetrieveAccessTokenRequest) (RetrieveAccessTokenResponse, error)
RetrieveAccessTokenDecoupled returns a bearer token to use for the Accounts and Payments API requests. Warning: Decoupled Authorisation flow is a mock version, and it is only intended to show how the production version will work.
API Documentation: https://developer.nordeaopenbanking.com/app/documentation?api=Identity%20and%20Access%20API&version=2.1#getToken