chore: 🤖 update token endpoint to match API

This commit is contained in:
Randall Morey committed 2021-02-26 10:42:19 -05:00
1 parent 4ae5e73def
commit e9c297b1cf
3 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ const methodHandlers = {
token_request_id: 'token_request_1234',
state: 'base_58_encoded_string'
}),
authenticate: (_, scopeAttrs) => {
'authenticate:token': (_, scopeAttrs) => {
oidcAttemptCounter++;
if (oidcAttemptCounter < oidcRequiredAttempts) {
return new Response(100);
+2 -2
View File
@@ -22,7 +22,7 @@ export default class OIDCAuthenticator extends BaseAuthenticator {
* @param {string} options.authMethod.id
* @return {string}
*/
buildAuthEndpointURL(/* {
buildTokenAuthEndpointURL(/* {
scope: { id: scopeID },
authMethod: { id: authMethodID },
} */) { }
@@ -79,7 +79,7 @@ export default class OIDCAuthenticator extends BaseAuthenticator {
*
*/
async attemptOIDCAuthentication(options) {
const url = this.buildAuthEndpointURL(options);
const url = this.buildTokenAuthEndpointURL(options);
const body = JSON.stringify({
state: this.session.get('data.pending.oidc.state'),
token_request_id: this.session.get('data.pending.oidc.token_request_id')
+5 -3
View File
@@ -35,19 +35,21 @@ export default class OIDCAuthenticator extends BaseOIDCAuthenticator {
}
/**
* Generates an auth method URL with which to authenticate.
* Generates a URL from which to obtain a ready Boundary token, after the
* OIDC authentication flow is completed. This endpoint may be polled by the
* client until the token becomes available.
* @override
* @param {object} options
* @param {string} options.scope.scope_id
* @param {string} options.authMethod.id
* @return {string}
*/
buildAuthEndpointURL({
buildTokenAuthEndpointURL({
scope: { id: scopeID },
authMethod: { id: authMethodID },
}) {
const adapter = this.store.adapterFor('application');
const options = { adapterOptions: { scopeID, method: 'authenticate' } };
const options = { adapterOptions: { scopeID, method: 'authenticate:token' } };
return adapter.buildURL('auth-method', authMethodID, options, 'findRecord');
}