@@ -81,7 +81,7 @@ class Client {
8181 errors . push ( 'Okta Org URL not provided' ) ;
8282 }
8383
84- if ( ! parsedConfig . client . token && parsedConfig . client . authorizationMode !== 'PrivateKey ') {
84+ if ( ! parsedConfig . client . token && parsedConfig . client . authorizationMode === 'SSWS ') {
8585 errors . push ( 'Okta API token not provided' ) ;
8686 }
8787
@@ -95,6 +95,16 @@ class Client {
9595 if ( ! parsedConfig . client . privateKey ) {
9696 errors . push ( 'Private Key not provided' ) ;
9797 }
98+ } else if ( parsedConfig . client . authorizationMode === 'ClientSecret' ) {
99+ if ( ! parsedConfig . client . clientId ) {
100+ errors . push ( 'Okta Client ID not provided' ) ;
101+ }
102+ if ( ! parsedConfig . client . scopes ) {
103+ errors . push ( 'Scopes not provided' ) ;
104+ }
105+ if ( ! parsedConfig . client . clientSecret ) {
106+ errors . push ( 'Okta Client Secret not provided' ) ;
107+ }
98108 } else if ( parsedConfig . client . authorizationMode !== 'SSWS' ) {
99109 errors . push ( 'Unknown Authorization Mode' ) ;
100110 }
@@ -111,6 +121,11 @@ class Client {
111121 this . privateKey = parsedConfig . client . privateKey ;
112122 this . keyId = parsedConfig . client . keyId ;
113123 this . oauth = new OAuth ( this ) ;
124+ } else if ( this . authorizationMode === 'ClientSecret' ) {
125+ this . clientId = parsedConfig . client . clientId ;
126+ this . scopes = parsedConfig . client . scopes . split ( ' ' ) ;
127+ this . clientSecret = parsedConfig . client . clientSecret ;
128+ this . oauth = new OAuth ( this ) ;
114129 }
115130
116131 this . http = new Http ( {
0 commit comments