< Return to Summary | File Generated: Thu Mar 28 2024 12:12:56 GMT+0000 (Coordinated Universal Time)
Booking Flow:
Opportunity Type:
Feature: Authentication / Dynamic Client Registration for Multiple Seller Systems (Implemented)
Test: Authorization Code Flow
The Authorization Code Flow allows Sellers to authenticate with Booking Partners
npm start -- --runInBand test/features/authentication/dynamic-client-registration/implemented/authorization-code-flow-test.js
The OpenActive Reference Implementation test result for this test can be used as a reference to help with debugging.
✅ 8 passed with 0 failures, 0 warnings and 0 suggestions
The test suite is using Dynamic Client Registration to retrieve credentials as part of this test, using the following configuration within bookingPartnersForSpecificTests.dynamicPrimary.authentication
:
dynamic-primary-745ddf2d13019ce8b69c
Hence the client_id
and client_secret
can be found within the Dynamic Client Registration response below.
GET https://localhost:5003/.well-known/openid-configuration
"application/json"
"gzip, deflate, br"
"localhost:5003"
Response status code: 200.
{
"issuer": "https://localhost:5003",
"jwks_uri": "https://localhost:5003/.well-known/openid-configuration/jwks",
"authorization_endpoint": "https://localhost:5003/connect/authorize",
"token_endpoint": "https://localhost:5003/connect/token",
"userinfo_endpoint": "https://localhost:5003/connect/userinfo",
"end_session_endpoint": "https://localhost:5003/connect/endsession",
"check_session_iframe": "https://localhost:5003/connect/checksession",
"revocation_endpoint": "https://localhost:5003/connect/revocation",
"introspection_endpoint": "https://localhost:5003/connect/introspect",
"device_authorization_endpoint": "https://localhost:5003/connect/deviceauthorization",
"frontchannel_logout_supported": true,
"frontchannel_logout_session_supported": true,
"backchannel_logout_supported": true,
"backchannel_logout_session_supported": true,
"scopes_supported": [
"openid",
"openactive-identity",
"openactive-openbooking",
"openactive-ordersfeed",
"offline_access"
],
"claims_supported": [
"sub",
"https://openactive.io/sellerId",
"https://openactive.io/sellerName",
"https://openactive.io/sellerUrl",
"https://openactive.io/sellerLogo",
"https://openactive.io/bookingServiceName",
"https://openactive.io/bookingServiceUrl",
"name",
"https://openactive.io/clientId"
],
"grant_types_supported": [
"authorization_code",
"client_credentials",
"refresh_token",
"implicit",
"urn:ietf:params:oauth:grant-type:device_code"
],
"response_types_supported": [
"code",
"token",
"id_token",
"id_token token",
"code id_token",
"code token",
"code id_token token"
],
"response_modes_supported": [
"form_post",
"query",
"fragment"
],
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"client_secret_post"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"subject_types_supported": [
"public"
],
"code_challenge_methods_supported": [
"plain",
"S256"
],
"request_parameter_supported": true,
"registration_endpoint": "https://localhost:5003/connect/register"
}
POST https://localhost:5003/connect/register
"Bearer dynamic-primary-745ddf2d13019ce8b69c"
"application/json"
"application/json"
"413"
"gzip, deflate, br"
"localhost:5003"
{
"redirect_uris": [
"http://localhost:3000/cb"
],
"grant_types": [
"authorization_code",
"refresh_token",
"client_credentials"
],
"client_name": "OpenActive Test Suite Client",
"client_uri": "https://github.com/openactive/openactive-test-suite",
"logo_uri": "https://via.placeholder.com/512x256.png?text=Logo",
"scope": "openid profile openactive-openbooking openactive-ordersfeed oauth-dymamic-client-update openactive-identity"
}
Response status code: 201.
{
"client_id": "2f80379c-9a8b-4ef6-ba32-9ddc8c6cea6e",
"client_secret": "6tw0O7QIYu3ehWxDHOgDi80OhcwStKxLuqZJOscFDEx",
"client_name": "OpenActive Test Suite Client",
"client_uri": "https://github.com/openactive/openactive-test-suite",
"initiate_login_uri": null,
"logo_uri": "https://via.placeholder.com/512x256.png?text=Logo",
"grant_types": [
"authorization_code",
"refresh_token",
"client_credentials"
],
"redirect_uris": [
"http://localhost:3000/cb"
],
"scope": "openid profile openactive-openbooking openactive-ordersfeed oauth-dymamic-client-update openactive-identity"
}
POST http://localhost:3000/browser-automation-for-auth
"application/json, text/plain, */*"
"application/json;charset=utf-8"
415
"localhost:3000"
{
"headless": true,
"offlineAccess": true,
"username": "test1",
"password": "test1",
"authorizationUrl": "https://localhost:5003/connect/authorize?client_id=2f80379c-9a8b-4ef6-ba32-9ddc8c6cea6e&scope=openid%20openactive-openbooking%20offline_access%20openactive-identity&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcb&code_challenge=9QvFsaBmWw-5wqFVfHtZItFbO_KchW1bN2zdsAVRu-U&code_challenge_method=S256"
}
"https://localhost:5003/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3D2f80379c-9a8b-4ef6-ba32-9ddc8c6cea6e%26scope%3Dopenid%2520openactive-openbooking%2520offline_access%2520openactive-identity%26response_type%3Dcode%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A3000%252Fcb%26code_challenge%3D9QvFsaBmWw-5wqFVfHtZItFbO_KchW1bN2zdsAVRu-U%26code_challenge_method%3DS256"
"https://localhost:5003/consent?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3D2f80379c-9a8b-4ef6-ba32-9ddc8c6cea6e%26scope%3Dopenid%2520openactive-openbooking%2520offline_access%2520openactive-identity%26response_type%3Dcode%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A3000%252Fcb%26code_challenge%3D9QvFsaBmWw-5wqFVfHtZItFbO_KchW1bN2zdsAVRu-U%26code_challenge_method%3DS256"
"/cb?code=D27340E607662A7FA67C6EB1435AB6A1B63A410B8B2DDDEFC80B718937F1574C&scope=openid%20openactive-openbooking%20offline_access%20openactive-identity&session_state=n9HZl5VlGFxbdY1tQNBQaUlGH_WkhgTbznHXtPS66vw.9A018C3F5A33CC678ED352C7803F5A9C"
POST https://localhost:5003/connect/token
"Basic MmY4MDM3OWMtOWE4Yi00ZWY2LWJhMzItOWRkYzhjNmNlYTZlOjZ0dzBPN1FJWXUzZWhXeERIT2dEaTgwT2hjd1N0S3hMdXFaSk9zY0ZERXg="
"application/json"
"application/x-www-form-urlencoded"
"205"
"gzip, deflate, br"
"localhost:5003"
"grant_type=authorization_code&code=D27340E607662A7FA67C6EB1435AB6A1B63A410B8B2DDDEFC80B718937F1574C&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcb&code_verifier=K6XTA69NkRmjn3ir1zil6wZx0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NptVM5-JG55tDQijj6QMoJdtPiNy2eS-bZCtKPL3IolbmKOAobp3C9x6aZApWCE-O1AZOpIibj6R-xkA3I9Ph4ZUZlTolCebqShLi8TNTeRQaHgp7TRUYtB3TkbY8ZR_qoKrFQlgmM4ApXdJ84Kpwuqyl6xLbDGwnsI9Trub3lWOnAIkwxBC_kUsmaOVA92nGFbkzhd58J5yF9Rg00ARn2m6rtg",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "DA92988C80C6467631889BA0A365719159DBF6B1EC6A7664342DB90E61E6A23B",
"scope": "openid openactive-openbooking offline_access openactive-identity"
}
GET https://localhost:5003/.well-known/openid-configuration/jwks
"application/json"
"gzip, deflate, br"
"localhost:5003"
Response status code: 200.
{
"keys": [
{
"kty": "RSA",
"use": "sig",
"kid": "B04F7B91DE3B9478C61833FB24AA5CDB",
"e": "AQAB",
"n": "yZO68vCGrvfBQ5R1z0DVCRAADOWeF3aLlhOaz1Je1SnmohmmlO-1F1hkRM_4MJtR5aECMxMz-MUW1nBCPmUrH0h_rrdCdDdlk8vTHki0ixK-gO73W2ZscOCZ6L2fZ2Oqz0_I840cnSCv55zpiOk9oGJL9TEsLAWYAIyQheaqZO3BkqImuBFmaLVTckvaZeONjHDQa01rxEjRQByir6oYSZPJy54XuRQJaPuCVNeOW8r0R9rKUQf9nl7tnVvhCsU3q1-UPrs8ZW_kaYXuYQJJMk392jX6XNm6czehIYM-O8Z5eGFdR3WW7IAWYEmqTCxrCRuuKU-EEcKOwksx8gBPgQ",
"alg": "RS256"
}
]
}
id_token
claims:
{
"nbf": 1711627979,
"exp": 1711628279,
"iss": "https://localhost:5003",
"aud": "2f80379c-9a8b-4ef6-ba32-9ddc8c6cea6e",
"iat": 1711627979,
"at_hash": "XvhvXkRGSeEUnTSgqmyaSw",
"sid": "F7C38EC1727AE3DDF8FDA42D3DAA18D8",
"sub": "100",
"auth_time": 1711627978,
"idp": "local",
"https://openactive.io/sellerName": "Acme Fitness Ltd",
"https://openactive.io/sellerId": "https://localhost:5001/api/identifiers/sellers/1",
"https://openactive.io/sellerUrl": "https://www.example.com",
"https://openactive.io/sellerLogo": "https://placekitten.com/640/360",
"amr": [
"pwd"
]
}
POST https://localhost:5003/connect/token
"Basic MmY4MDM3OWMtOWE4Yi00ZWY2LWJhMzItOWRkYzhjNmNlYTZlOjZ0dzBPN1FJWXUzZWhXeERIT2dEaTgwT2hjd1N0S3hMdXFaSk9zY0ZERXg="
"application/json"
"application/x-www-form-urlencoded"
"103"
"gzip, deflate, br"
"localhost:5003"
"grant_type=refresh_token&refresh_token=DA92988C80C6467631889BA0A365719159DBF6B1EC6A7664342DB90E61E6A23B"
Response status code: 200.
{
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiSldUIn0.eyJuYmYiOjE3MTE2Mjc5NzksImV4cCI6MTcxMTYyODI3OSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6IjJmODAzNzljLTlhOGItNGVmNi1iYTMyLTlkZGM4YzZjZWE2ZSIsImlhdCI6MTcxMTYyNzk3OSwiYXRfaGFzaCI6IndJRTJyNjhNWXdlVU9jX1JkazYxYnciLCJzdWIiOiIxMDAiLCJhdXRoX3RpbWUiOjE3MTE2Mjc5NzgsImlkcCI6ImxvY2FsIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL3NlbGxlck5hbWUiOiJBY21lIEZpdG5lc3MgTHRkIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL3NlbGxlcklkIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMS9hcGkvaWRlbnRpZmllcnMvc2VsbGVycy8xIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL3NlbGxlclVybCI6Imh0dHBzOi8vd3d3LmV4YW1wbGUuY29tIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL3NlbGxlckxvZ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iLCJvcGVuYWN0aXZlLW9wZW5ib29raW5nIiwib3BlbmFjdGl2ZS1pZGVudGl0eSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXX0.viA5KswRU_VA9FJd2-zCEXNVDZ9lRIQWnkG7FwJU9Dc6fXCM7NOjcJcfRTd0Qeisoo-I3dF6IjWV5KDwJRztRfPoQhUFZEAUg5Cy7NzkyaOP7FesyHbnSFndtpAI6ZPuUPA72i9Ss5JwpMGs7-pby7Tk0uRCSCwmOEmRfgKkdZXVkV3hLSb8z3pNd4rlx0R9rlLrt6OJ3Czoo9R2GNSPANTtE1b4ETGGnpIafaNYPYNs7Y5uY15qqX7ocdyYU9ix8MXP2kT4ZZT3NtIUY0s4tba8mzpt3ETiHO_iD68GFIO4KxN9kl0fEQp2GGZBRQemKo4NBxgY9lPMDUxzB8c_Nw",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "5AB3A3E9F426359B79ACB3EDADC14D2CAEE57036C4EF1F475F49862C604FFCBF",
"scope": "openid openactive-openbooking openactive-identity offline_access"
}
https://openactive.io/sellerId
claim in id_token
id_token
as defined in specification