@@ -310,22 +310,22 @@ export enum SUBJECT_TOKEN_TYPES {
310310 *
311311 * @see {@link https://tools.ietf.org/html/rfc8693#section-3.1 RFC 8693 Section 3.1 }
312312 */
313- SUBJECT_TYPE_REFRESH_TOKEN = 'urn:ietf:params:oauth:token-type:refresh_token' ,
313+ REFRESH_TOKEN = 'urn:ietf:params:oauth:token-type:refresh_token' ,
314314
315315 /**
316316 * Constant representing the subject type for a access token.
317317 * This is used in OAuth 2.0 token exchange to specify that the token being exchanged is an access token.
318318 *
319319 * @see {@link https://tools.ietf.org/html/rfc8693#section-3.1 RFC 8693 Section 3.1 }
320320 */
321- SUBJECT_TYPE_ACCESS_TOKEN = 'urn:ietf:params:oauth:token-type:access_token' ,
321+ ACCESS_TOKEN = 'urn:ietf:params:oauth:token-type:access_token' ,
322322}
323323
324324export const TOKEN_FOR_CONNECTION_GRANT_TYPE =
325325 'urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token' ;
326326
327327/**
328- * @deprecated Use {@link SUBJECT_TOKEN_TYPES.SUBJECT_TYPE_REFRESH_TOKEN } instead.
328+ * @deprecated Use {@link SUBJECT_TOKEN_TYPES.REFRESH_TOKEN } instead.
329329 */
330330export const TOKEN_FOR_CONNECTION_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:refresh_token' ;
331331export const TOKEN_FOR_CONNECTION_REQUESTED_TOKEN_TYPE =
@@ -636,16 +636,10 @@ export class OAuth extends BaseAuthAPI {
636636 ) : Promise < JSONApiResponse < TokenSet > > {
637637 validateRequiredRequestParams ( bodyParameters , [ 'connection' , 'subject_token' ] ) ;
638638
639- let subjectTokenType = SUBJECT_TOKEN_TYPES . SUBJECT_TYPE_REFRESH_TOKEN ;
640-
641- if ( bodyParameters . subject_token_type ) {
642- subjectTokenType = bodyParameters . subject_token_type ;
643- }
644-
645639 const body : Record < string , string > = {
640+ subject_token_type : SUBJECT_TOKEN_TYPES . REFRESH_TOKEN ,
646641 ...bodyParameters ,
647642 grant_type : TOKEN_FOR_CONNECTION_GRANT_TYPE ,
648- subject_token_type : subjectTokenType ,
649643 requested_token_type : TOKEN_FOR_CONNECTION_REQUESTED_TOKEN_TYPE ,
650644 } ;
651645
0 commit comments