TBC ID
TBC ID provides OpenID Connect APIs for authenticating users, obtaining their consent, and retrieving the user information and claims authorized by the user.
The API supports the Authorization Code Flow with PKCE and Client-Initiated Backchannel Authentication (CIBA), including token issuance and refresh.
It also provides OpenID Connect discovery metadata and public signing keys (JWKS) for validating tokens.
Use the access token issued by the selected flow to request authorized claims from the Userinfo endpoint.
Endpoints
Sandbox Base URLs:
Production Base URLs:
Proccess
Authorization Code Flow
- Prepare the request. Create a fresh, unpredictable
statevalue bound to the user's session. If an ID token is expected, also create a freshnonce. Add aclaimsobject to request the user claims your application needs from the UserInfo endpoint; request only claims supported by the provider. If using PKCE, generate and retain thecode_verifierand correspondingcode_challenge. - Start authorization. Redirect the user's browser to the authorization endpoint, including the registered
client_idandredirect_uri,response_type=code, the requested scopes includingopenid, and applicable security and optional parameters. - Follow the consent redirect. The authorization endpoint returns
302 Foundwith the consent page URL in theLocationheader. Redirect the user's browser there so they can approve or decline the request. - Handle the callback. After the user makes a decision, TBC Bank redirects the browser to the registered
redirect_uriwith either an authorizationcodeor anerroranderror_description. Validate the returnedstatebefore processing the response. If the user approved, keep the code confidential and exchange it promptly. - Exchange the code. Send the code to the token endpoint along with the required form parameters. If using PKCE, include the original
code_verifier. - Use the tokens. Validate the token response and the ID token, including its signature, issuer, audience, expiration, and
noncewhen applicable. Check that the ID token'sacrreflects the authentication class actually performed. Use the access token to call the authorized resource. To retrieve user claims, call the UserInfo endpoint.
CIBA Flow
- Start authentication. Send the initial backchannel authorization request with
client_id, the user'slogin_hint, and all requestedscopeandclaims(including verified claims). Include any applicableui_locales.IMPORTANT:
Send all requested claims, including verified claims, in the initial backchannel authorization request. - Get the request ID. TBC Bank returns an
auth_req_idand polling information. If the request is rejected, handle the error and stop the flow. - SMS is sent. Immediately after the initial backchannel authorization request, TBC Bank sends an SMS OTP to the user.
- Poll for the first token response. After the SMS is sent, poll the token endpoint using the CIBA
grant_typeand the initialauth_req_id. Continue at the instructed interval while the request is pending. When this authentication phase completes, TBC Bank returns anid_tokenand anaccess_token. This first response must not contain arefresh_token. Check whether the ID token is intermediate or final, as described in section 10.2.3 of the applicable specification:- Final ID token: authentication is complete. Do not send a second backchannel request; use the access token as authorized for the resource.
- Intermediate ID token: retain the intermediate ID token and access token, then continue to the next step.
IMPORTANT:
The intermediate token response is not the final resource authorization when its ID token is identified as intermediate.
- Submit the SMS code. After the user enters the OTP in your application, send a second backchannel authorization request with
client_id, the intermediate ID token asid_token_hint, and the OTP asuser_code. - Poll for final tokens. Use the second request's
auth_req_idto poll the token endpoint. On success, TBC Bank returns a newid_tokenandaccess_token; arefresh_tokenmay also be returned. - Use the access token. Once authentication is complete, validate the token response and use its access token to call the authorized resource. This is the first response's access token when its ID token is final, or the second response's access token when the first ID token is intermediate. To retrieve user claims, call the UserInfo endpoint.
