{"version":3,"file":"DeviceCodeClient.js","sources":["../../src/client/DeviceCodeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { DeviceCodeResponse, ServerDeviceCodeResponse } from \"../response/DeviceCodeResponse\";\r\nimport { BaseClient } from \"./BaseClient\";\r\nimport { CommonDeviceCodeRequest } from \"../request/CommonDeviceCodeRequest\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\r\nimport { Constants, GrantType } from \"../utils/Constants\";\r\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\r\nimport { TimeUtils } from \"../utils/TimeUtils\";\r\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\r\nimport { ResponseHandler } from \"../response/ResponseHandler\";\r\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\r\nimport { ServerError } from \"../error/ServerError\";\r\n\r\n/**\r\n * OAuth2.0 Device code client\r\n */\r\nexport class DeviceCodeClient extends BaseClient {\r\n\r\n constructor(configuration: ClientConfiguration) {\r\n super(configuration);\r\n }\r\n\r\n /**\r\n * Gets device code from device code endpoint, calls back to with device code response, and\r\n * polls token endpoint to exchange device code for tokens\r\n * @param request\r\n */\r\n public async acquireToken(request: CommonDeviceCodeRequest): Promise {\r\n const deviceCodeResponse: DeviceCodeResponse = await this.getDeviceCode(request);\r\n request.deviceCodeCallback(deviceCodeResponse);\r\n const reqTimestamp = TimeUtils.nowSeconds();\r\n const response: ServerAuthorizationTokenResponse = await this.acquireTokenWithDeviceCode(\r\n request,\r\n deviceCodeResponse);\r\n\r\n const responseHandler = new ResponseHandler(\r\n this.config.authOptions.clientId,\r\n this.cacheManager,\r\n this.cryptoUtils,\r\n this.logger,\r\n this.config.serializableCache,\r\n this.config.persistencePlugin\r\n );\r\n\r\n // Validate response. This function throws a server error if an error is returned by the server.\r\n responseHandler.validateTokenResponse(response);\r\n return await responseHandler.handleServerTokenResponse(\r\n response,\r\n this.authority,\r\n reqTimestamp,\r\n request\r\n );\r\n }\r\n\r\n /**\r\n * Creates device code request and executes http GET\r\n * @param request\r\n */\r\n private async getDeviceCode(request: CommonDeviceCodeRequest): Promise {\r\n const queryString = this.createQueryString(request);\r\n const headers = this.createTokenRequestHeaders();\r\n const thumbprint: RequestThumbprint = {\r\n clientId: this.config.authOptions.clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n\r\n return this.executePostRequestToDeviceCodeEndpoint(this.authority.deviceCodeEndpoint, queryString, headers, thumbprint);\r\n }\r\n\r\n /**\r\n * Executes POST request to device code endpoint\r\n * @param deviceCodeEndpoint\r\n * @param queryString\r\n * @param headers\r\n */\r\n private async executePostRequestToDeviceCodeEndpoint(\r\n deviceCodeEndpoint: string,\r\n queryString: string,\r\n headers: Record,\r\n thumbprint: RequestThumbprint): Promise {\r\n\r\n const {\r\n body: {\r\n user_code: userCode,\r\n device_code: deviceCode,\r\n verification_uri: verificationUri,\r\n expires_in: expiresIn,\r\n interval,\r\n message\r\n }\r\n } = await this.networkManager.sendPostRequest(\r\n thumbprint,\r\n deviceCodeEndpoint,\r\n {\r\n body: queryString,\r\n headers: headers,\r\n proxyUrl: this.config.systemOptions.proxyUrl\r\n });\r\n\r\n return {\r\n userCode,\r\n deviceCode,\r\n verificationUri,\r\n expiresIn,\r\n interval,\r\n message\r\n };\r\n }\r\n\r\n /**\r\n * Create device code endpoint query parameters and returns string\r\n */\r\n private createQueryString(request: CommonDeviceCodeRequest): string {\r\n\r\n const parameterBuilder: RequestParameterBuilder = new RequestParameterBuilder();\r\n\r\n parameterBuilder.addScopes(request.scopes);\r\n parameterBuilder.addClientId(this.config.authOptions.clientId);\r\n\r\n if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n\r\n return parameterBuilder.createQueryString();\r\n }\r\n\r\n /**\r\n * Breaks the polling with specific conditions.\r\n * @param request CommonDeviceCodeRequest\r\n * @param deviceCodeResponse DeviceCodeResponse\r\n */\r\n private continuePolling(\r\n deviceCodeExpirationTime: number,\r\n userSpecifiedTimeout?: number,\r\n userSpecifiedCancelFlag?: boolean,\r\n ): boolean {\r\n if (userSpecifiedCancelFlag) {\r\n this.logger.error(\"Token request cancelled by setting DeviceCodeRequest.cancel = true\");\r\n throw ClientAuthError.createDeviceCodeCancelledError();\r\n } else if (userSpecifiedTimeout && userSpecifiedTimeout < deviceCodeExpirationTime && TimeUtils.nowSeconds() > userSpecifiedTimeout) {\r\n this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${userSpecifiedTimeout}`);\r\n throw ClientAuthError.createUserTimeoutReachedError();\r\n } else if (TimeUtils.nowSeconds() > deviceCodeExpirationTime) {\r\n if (userSpecifiedTimeout) {\r\n this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${userSpecifiedTimeout}`);\r\n }\r\n this.logger.error(`Device code expired. Expiration time of device code was ${deviceCodeExpirationTime}`);\r\n throw ClientAuthError.createDeviceCodeExpiredError();\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Creates token request with device code response and polls token endpoint at interval set by the device code\r\n * response\r\n * @param request\r\n * @param deviceCodeResponse\r\n */\r\n private async acquireTokenWithDeviceCode(\r\n request: CommonDeviceCodeRequest,\r\n deviceCodeResponse: DeviceCodeResponse): Promise {\r\n\r\n const requestBody = this.createTokenRequestBody(request, deviceCodeResponse);\r\n const headers: Record = this.createTokenRequestHeaders();\r\n\r\n const userSpecifiedTimeout = request.timeout ? TimeUtils.nowSeconds() + request.timeout : undefined;\r\n const deviceCodeExpirationTime = TimeUtils.nowSeconds() + deviceCodeResponse.expiresIn;\r\n const pollingIntervalMilli = deviceCodeResponse.interval * 1000;\r\n\r\n /*\r\n * Poll token endpoint while (device code is not expired AND operation has not been cancelled by\r\n * setting CancellationToken.cancel = true). POST request is sent at interval set by pollingIntervalMilli\r\n */\r\n while (this.continuePolling(deviceCodeExpirationTime, userSpecifiedTimeout, request.cancel)) {\r\n const thumbprint: RequestThumbprint = {\r\n clientId: this.config.authOptions.clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n\r\n const response = await this.executePostToTokenEndpoint(\r\n this.authority.tokenEndpoint,\r\n requestBody,\r\n headers,\r\n thumbprint);\r\n\r\n if (response.body && response.body.error) {\r\n // user authorization is pending. Sleep for polling interval and try again\r\n if(response.body.error === Constants.AUTHORIZATION_PENDING) {\r\n this.logger.info(\"Authorization pending. Continue polling.\");\r\n await TimeUtils.delay(pollingIntervalMilli);\r\n } else {\r\n // for any other error, throw\r\n this.logger.info(\"Unexpected error in polling from the server\");\r\n throw ServerError.createPostRequestFailed(response.body.error);\r\n }\r\n } else {\r\n this.logger.verbose(\"Authorization completed successfully. Polling stopped.\");\r\n return response.body;\r\n }\r\n }\r\n\r\n /*\r\n * The above code should've thrown by this point, but to satisfy TypeScript,\r\n * and in the rare case the conditionals in continuePolling() may not catch everything...\r\n */\r\n this.logger.error(\"Polling stopped for unknown reasons.\");\r\n throw ClientAuthError.createDeviceCodeUnknownError();\r\n }\r\n\r\n /**\r\n * Creates query parameters and converts to string.\r\n * @param request\r\n * @param deviceCodeResponse\r\n */\r\n private createTokenRequestBody(request: CommonDeviceCodeRequest, deviceCodeResponse: DeviceCodeResponse): string {\r\n\r\n const requestParameters: RequestParameterBuilder = new RequestParameterBuilder();\r\n\r\n requestParameters.addScopes(request.scopes);\r\n requestParameters.addClientId(this.config.authOptions.clientId);\r\n requestParameters.addGrantType(GrantType.DEVICE_CODE_GRANT);\r\n requestParameters.addDeviceCode(deviceCodeResponse.deviceCode);\r\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\r\n requestParameters.addCorrelationId(correlationId);\r\n requestParameters.addClientInfo();\r\n requestParameters.addLibraryInfo(this.config.libraryInfo);\r\n requestParameters.addApplicationTelemetry(this.config.telemetry.application);\r\n requestParameters.addThrottling();\r\n if (this.serverTelemetryManager) {\r\n requestParameters.addServerTelemetry(this.serverTelemetryManager);\r\n }\r\n\r\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n requestParameters.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n return requestParameters.createQueryString();\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AAiBH;;AAEG;AACH,IAAA,gBAAA,kBAAA,UAAA,MAAA,EAAA;IAAsC,SAAU,CAAA,gBAAA,EAAA,MAAA,CAAA,CAAA;AAE5C,IAAA,SAAA,gBAAA,CAAY,aAAkC,EAAA;AAC1C,QAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,aAAa,CAAC,IAAA,IAAA,CAAA;KACvB;AAED;;;;AAIG;IACU,gBAAY,CAAA,SAAA,CAAA,YAAA,GAAzB,UAA0B,OAAgC,EAAA;;;;;AACP,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA,CAAA;;AAA1E,wBAAA,kBAAkB,GAAuB,EAAiC,CAAA,IAAA,EAAA,CAAA;AAChF,wBAAA,OAAO,CAAC,kBAAkB,CAAC,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