chore: add mock authenticate:start endpoint

This commit is contained in:
Randall Morey committed 2021-01-19 15:43:45 -05:00
1 parent a3c12b36e7
commit af8947dc62
1 file changed
+20
+20
View File
@@ -38,6 +38,26 @@ const methodHandlers = {
last_used_time: '',
expiration_time: ''
})
},
/**
* OIDC authentication is a two-step process:
*
* 1. `authenticate:start` kicks of authentication by requesting some details
* from the Boundary server about the request, including the third-party
* URL to which to redirect the user.
* 2. `authenticate` accepts the token_request_id and state parameters in
* order to retrieve a Boundary token. This endpoint may be polled until
* the authentication flow is completed.
*/
oidc: {
'authenticate:start': () =>
new Response(200, {}, {
authorization_request_url: 'https://www.duckduckgo.com',
retreival_url: '',
token_request_id: 'token_request_1234',
state: 'base_58_encoded_string'
}),
authenticate: () => new Response(200) // TODO
}
};