For developers
Start with card issuing

Authentication

12min
oauth 2 0 is a popular protocol for authorization this controls entry to our system and ensures that only authorized entities can access our apis and other protected resources the information you enter into our authentication system is confidential and can never be accessed from any other cross river applications access cross river apis our system authenticates machine clients and authorizes them to talk to our apis authenticate your identity the cross river integration team provides you with a client id and a client secret that you use when requesting an access token you can use a web based tool, like postman , to send api requests https request components http component attribute description endpoint post /connect/token endpoint for retrieving an access token header content type application/x www form urlencoded body grant type this field will always have a value of client credentials body client id the unique identifier for a client body client secret an encrypted string of characters used to sign and validate id tokens important secrets aren't recoverable by cr if you lose a secret, a new one must be generated do not commit your secrets into source control body audience a way for the user to validate if a particular access token is meant for them get an access token sample call for an access token in curl curl location request post 'https //idptest crbcos com/connect/token' \\ \ header 'content type application/x www form urlencoded' \\ \ data urlencode 'grant type=client credentials' \\ \ data urlencode 'client id=\[your id here]' \\ \ data urlencode 'client secret=\[your secret here]' \\ \ data urlencode 'audience=https //api crbcos com/'authentication clientidsecret png sample call for an access token in postman request tokens using explorer go into the explorer, click the arrow down next your login, and click copy access token the access token is copied to your clipboard and ready for use in the sandbox request tokens using the api cos uses openid connect and oauth 2 0 for authentication and authorization before you can use the api, you must obtain an access token using the client id and client secret provided to you once a token has been obtained, it must be passed in the authorization header of each request to the api to request a token send a post to our auth server containing the client id and client secret provided sample request in curl curl location request post 'https //idptest crbcos com/connect/token' \\ \ header 'content type application/x www form urlencoded' \\ \ data urlencode 'grant type=client credentials' \\ \ data urlencode 'client id=\[your id here]' \\ \ data urlencode 'client secret=\[your secret here]' \\ \ data urlencode 'audience=https //api crbcos com/' successful authentication and access token returned when you've successfully authenticated, an access token will be returned to you this access token allows you to send information securely as a json object for use in our apis add this token to the header of your api calls important make sure to protect your token don’t log it anyone who steals your token can impersonate your client for the lifetime of the token sample response from curl request { "access token" "xxxxx", "expires in" 86400, "token type" "bearer" } present tokens i n the request header in the header of each api request, the access token obtained should be included as follows api request header authorization bearer \[your token here] sample call for wire payment in curl curl location request post 'https //sandbox crbcos com/wires/v1/payments' \\ \ header 'authorization bearer \[your token here]' \\ \ header 'content type application/x www form urlencoded' \\ \ data raw '{ "accountnumber" "2255685659", "businessfunctioncode" "ctr", "receiverroutingnumber" "021000021", "beneficiaryfi" { "idcode" "f", "identifier" "021000021", "name" "jp morgan chase" }, "beneficiary" { "idcode" "d", "identifier" "123456789", "name" "peter griffin" }, "beneficiaryreference" "xyz123", "amount" 10000, "purpose" "payment" }' in swagger in the top of the swagger screen, paste the token from the clipboard into the token field and click explore the token is now activated the access token should be stored and used until it expires the token response you receive specifies the expiration time in seconds do not request a new token for every api request it is recommended you use the current token until you receive a 401 unauthorized error, at which point you would request a new token