< Return to Summary | File Generated: Thu May 09 2024 14:54:45 GMT+0000 (Coordinated Universal Time)
Booking Flow:
Opportunity Type:
Feature: Authentication / Dynamic Client Registration for Multiple Seller Systems (Implemented)
Test: Client Credentials Flow
Client Credentials Flow allows Booking Partners to access the Orders Feed
npm start -- --runInBand test/features/authentication/dynamic-client-registration/implemented/client-credentials-flow-test.js
The OpenActive Reference Implementation test result for this test can be used as a reference to help with debugging.
✅ 4 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.dynamicSecondary.authentication
:
dynamic-secondary-a21518cb57af7b6052df
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-secondary-a21518cb57af7b6052df"
"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": "ed3550c5-3c9d-4d46-bec8-0f536c90c272",
"client_secret": "2XCYDKdq0holwvw7yX6EOFQnSLWmfBaOd5B8putcXeW",
"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 https://localhost:5003/connect/token
"Basic ZWQzNTUwYzUtM2M5ZC00ZDQ2LWJlYzgtMGY1MzZjOTBjMjcyOjJYQ1lES2RxMGhvbHd2dzd5WDZFT0ZRblNMV21mQmFPZDVCOHB1dGNYZVc="
"application/json"
"application/x-www-form-urlencoded"
"57"
"gzip, deflate, br"
"localhost:5003"
"grant_type=client_credentials&scope=openactive-ordersfeed"
Response status code: 200.
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTUyNjY0ODYsImV4cCI6MTcxNTI3MDA4NiwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiZWQzNTUwYzUtM2M5ZC00ZDQ2LWJlYzgtMGY1MzZjOTBjMjcyIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiZWQzNTUwYzUtM2M5ZC00ZDQ2LWJlYzgtMGY1MzZjOTBjMjcyIiwianRpIjoiNTBGNTM3M0I4NzQ0N0VGRDlEQTRBODExMzFGNEE5MTUiLCJpYXQiOjE3MTUyNjY0ODYsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.S5fs5x_Jy4rTpQJStYrEymxZAs4JtXogNwJp5JhWBWO4PmvFvCucoDzDymFjupcbc2rmrFxkyvNYGl8qTNFXNKUQlzwzs6DDYfvQ6EiSoN8kDzwCXL4I2KEzezHn8-9_CVoB5xxtMpWGUn4mjgcAjAGRaeW2wBxeuXO0Zop_uooK5wbJV2-hc9Yiim71fQiNdVNwz25v_D0Y18egu7hvvl1zVSCGiA6Druo4vI3ylxtrhEtkPR1N2ngk5SGukcm_Pb3EtCMdIJz5n6eerW82JDd4Y2y8-xmaTDTh1_l7WDbjxaQfH9QalrkXGzZBXNdlaoPm8Fqtbw4MgPGB_phI-w",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "openactive-ordersfeed"
}