@@ -17,17 +17,24 @@ import { AuthInfo, DEFAULT_CONNECTED_APP_INFO } from './org/authInfo';
1717import { SFDX_HTTP_HEADERS } from './org/connection' ;
1818import { SfError } from './sfError' ;
1919import { Messages } from './messages' ;
20+ import { Lifecycle } from './lifecycleEvents' ;
2021
2122Messages . importMessagesDirectory ( __dirname ) ;
2223const messages = Messages . loadMessages ( '@salesforce/core' , 'auth' ) ;
2324
25+ /**
26+ * @deprecated Will be removed mid January 2026
27+ */
2428export type DeviceCodeResponse = {
2529 device_code : string ;
2630 interval : number ;
2731 user_code : string ;
2832 verification_uri : string ;
2933} & JsonMap ;
3034
35+ /**
36+ * @deprecated Will be removed mid January 2026
37+ */
3138export type DeviceCodePollingResponse = {
3239 access_token : string ;
3340 refresh_token : string ;
@@ -68,20 +75,9 @@ async function makeRequest<T extends JsonMap>(options: HttpRequest): Promise<T>
6875}
6976
7077/**
71- * Handles device based login flows
78+ * THIS CLASS IS DEPRECATED AND WILL BE REMOVED MID JANUARY 2026.
7279 *
73- * Usage:
74- * ```
75- * const oauthConfig = {
76- * loginUrl: this.flags.instanceurl,
77- * clientId: this.flags.clientid,
78- * };
79- * const deviceOauthService = await DeviceOauthService.create(oauthConfig);
80- * const loginData = await deviceOauthService.requestDeviceLogin();
81- * console.log(loginData);
82- * const approval = await deviceOauthService.awaitDeviceApproval(loginData);
83- * const authInfo = await deviceOauthService.authorizeAndSave(approval);
84- * ```
80+ * @deprecated Use WebOAuthServer instead
8581 */
8682export class DeviceOauthService extends AsyncCreatable < OAuth2Config > {
8783 public static RESPONSE_TYPE = 'device_code' ;
@@ -95,6 +91,7 @@ export class DeviceOauthService extends AsyncCreatable<OAuth2Config> {
9591
9692 public constructor ( options : OAuth2Config ) {
9793 super ( options ) ;
94+ void Lifecycle . getInstance ( ) . emitWarning ( 'Device Oauth flow is deprecated and will be removed mid January 2026' ) ;
9895 this . options = options ;
9996 if ( ! this . options . clientId ) this . options . clientId = DEFAULT_CONNECTED_APP_INFO . clientId ;
10097 if ( ! this . options . loginUrl ) this . options . loginUrl = AuthInfo . getDefaultInstanceUrl ( ) ;
0 commit comments