@@ -220,9 +220,9 @@ protected static IHttpClient buildDefaultHttpClient(int timeout = Configuration.
220220 /// <value>An instance of the RestClient</value>
221221 public IHttpClient RestClient { get ; set ; }
222222
223- public DocuSignRequest PrepareOAuthRequest ( string oAuthBasePath , string path , HttpMethod method , List < KeyValuePair < string , string > > headerParams = null , List < KeyValuePair < string , string > > formParams = null )
223+ public DocuSignRequest PrepareOAuthRequest ( string oAuthBasePathParam , string path , HttpMethod method , List < KeyValuePair < string , string > > headerParams = null , List < KeyValuePair < string , string > > formParams = null )
224224 {
225- string url = $ "https://{ oAuthBasePath } /{ path } ";
225+ string url = $ "https://{ oAuthBasePathParam } /{ path } ";
226226
227227 if ( ! headerParams . Any ( kvp => kvp . Key ? . Equals ( "Content-Type" ) ?? false ) ) { headerParams . Add ( new KeyValuePair < string , string > ( "Content-Type" , "application/x-www-form-urlencoded" ) ) ; }
228228 if ( ! headerParams . Any ( kvp => kvp . Key ? . Equals ( "Cache-Control" ) ?? false ) ) { headerParams . Add ( new KeyValuePair < string , string > ( "Cache-Control" , "no-store" ) ) ; }
@@ -914,7 +914,7 @@ public OAuth.UserInfo GetUserInfo(string accessToken)
914914 if ( localVarHeaderParams . ContainsKey ( "Authorization" ) ) { localVarHeaderParams . Remove ( "Authorization" ) ; }
915915 localVarHeaderParams . Add ( "Authorization" , "Bearer " + accessToken ) ;
916916
917- DocuSignRequest request = PrepareOAuthRequest ( oAuthBasePath , $ "oauth/userinfo", HttpMethod . Get , localVarHeaderParams . ToList ( ) , localVarFormParams . ToList ( ) ) ;
917+ DocuSignRequest request = PrepareOAuthRequest ( this . oAuthBasePath , $ "oauth/userinfo", HttpMethod . Get , localVarHeaderParams . ToList ( ) , localVarFormParams . ToList ( ) ) ;
918918 DocuSignResponse response = await RestClient . SendRequestAsync ( request , cancellationToken ) ;
919919
920920 if ( response . StatusCode >= HttpStatusCode . OK && response . StatusCode < HttpStatusCode . BadRequest )
@@ -964,7 +964,7 @@ protected static RSA CreateRSAKeyFromPem(string key)
964964 /// </summary>
965965 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
966966 /// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
967- /// <param name="oauthBasePath "> Docusign OAuth base path
967+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
968968 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
969969 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
970970 /// </param>
@@ -974,12 +974,12 @@ protected static RSA CreateRSAKeyFromPem(string key)
974974 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
975975 /// </param>
976976 /// <returns>The JWT user token</returns>
977- public OAuth . OAuthToken RequestJWTUserToken ( string clientId , string userId , string oauthBasePath , Stream privateKeyStream , int expiresInHours , List < string > scopes = null )
977+ public OAuth . OAuthToken RequestJWTUserToken ( string clientId , string userId , string oAuthBasePathParam , Stream privateKeyStream , int expiresInHours , List < string > scopes = null )
978978 {
979979 using ( var cts = new CancellationTokenSource ( ) )
980980 {
981981 return TryCatchWrapper ( ( ) => {
982- var task = Task . Run ( async ( ) => await RequestJWTUserTokenAsync ( clientId , userId , oauthBasePath , privateKeyStream , expiresInHours , scopes , cts . Token ) ) ;
982+ var task = Task . Run ( async ( ) => await RequestJWTUserTokenAsync ( clientId , userId , oAuthBasePathParam , privateKeyStream , expiresInHours , scopes , cts . Token ) ) ;
983983 task . Wait ( ) ;
984984 return task . Result ;
985985 } ) ;
@@ -992,7 +992,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
992992 /// </summary>
993993 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
994994 /// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
995- /// <param name="oauthBasePath "> Docusign OAuth base path
995+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
996996 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
997997 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
998998 /// </param>
@@ -1003,12 +1003,12 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10031003 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
10041004 /// </param>
10051005 /// <returns>The JWT user token</returns>
1006- public async Task < OAuth . OAuthToken > RequestJWTUserTokenAsync ( string clientId , string userId , string oauthBasePath , Stream privateKeyStream , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
1006+ public async Task < OAuth . OAuthToken > RequestJWTUserTokenAsync ( string clientId , string userId , string oAuthBasePathParam , Stream privateKeyStream , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
10071007 {
10081008 if ( privateKeyStream != null && privateKeyStream . CanRead && privateKeyStream . Length > 0 )
10091009 {
10101010 byte [ ] privateKeyBytes = ReadAsBytes ( privateKeyStream ) ;
1011- return await this . RequestJWTUserTokenAsync ( clientId , userId , oauthBasePath , privateKeyBytes , expiresInHours , scopes , cancellationToken ) ;
1011+ return await this . RequestJWTUserTokenAsync ( clientId , userId , oAuthBasePathParam , privateKeyBytes , expiresInHours , scopes , cancellationToken ) ;
10121012 }
10131013 else
10141014 {
@@ -1022,7 +1022,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10221022 /// </summary>
10231023 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
10241024 /// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
1025- /// <param name="oauthBasePath "> Docusign OAuth base path
1025+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
10261026 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
10271027 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
10281028 /// </param>
@@ -1032,13 +1032,13 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10321032 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
10331033 /// </param>
10341034 /// <returns>The JWT user token</returns>
1035- public OAuth . OAuthToken RequestJWTUserToken ( string clientId , string userId , string oauthBasePath , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null )
1035+ public OAuth . OAuthToken RequestJWTUserToken ( string clientId , string userId , string oAuthBasePathParam , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null )
10361036 {
10371037
10381038 using ( var cts = new CancellationTokenSource ( ) )
10391039 {
10401040 return TryCatchWrapper ( ( ) => {
1041- var task = Task . Run ( async ( ) => await RequestJWTUserTokenAsync ( clientId , userId , oauthBasePath , privateKeyBytes , expiresInHours , scopes , cts . Token ) ) ;
1041+ var task = Task . Run ( async ( ) => await RequestJWTUserTokenAsync ( clientId , userId , oAuthBasePathParam , privateKeyBytes , expiresInHours , scopes , cts . Token ) ) ;
10421042 task . Wait ( ) ;
10431043 return task . Result ;
10441044 } ) ;
@@ -1051,7 +1051,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10511051 /// </summary>
10521052 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
10531053 /// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
1054- /// <param name="oauthBasePath "> Docusign OAuth base path
1054+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
10551055 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
10561056 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
10571057 /// </param>
@@ -1062,7 +1062,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10621062 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
10631063 /// </param>
10641064 /// <returns>The JWT user token</returns>
1065- public async Task < OAuth . OAuthToken > RequestJWTUserTokenAsync ( string clientId , string userId , string oauthBasePath , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
1065+ public async Task < OAuth . OAuthToken > RequestJWTUserTokenAsync ( string clientId , string userId , string oAuthBasePathParam , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
10661066 {
10671067 string privateKey = Encoding . UTF8 . GetString ( privateKeyBytes ) ;
10681068
@@ -1081,7 +1081,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
10811081
10821082 descriptor . Subject = new ClaimsIdentity ( ) ;
10831083 descriptor . Subject . AddClaim ( new Claim ( "scope" , String . Join ( " " , scopes ) ) ) ;
1084- descriptor . Subject . AddClaim ( new Claim ( "aud" , oauthBasePath ) ) ;
1084+ descriptor . Subject . AddClaim ( new Claim ( "aud" , oAuthBasePathParam ) ) ;
10851085 descriptor . Subject . AddClaim ( new Claim ( "iss" , clientId ) ) ;
10861086
10871087 if ( ! string . IsNullOrEmpty ( userId ) )
@@ -1112,7 +1112,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
11121112 { "assertion" , jwtToken }
11131113 } ;
11141114
1115- DocuSignRequest request = PrepareOAuthRequest ( oauthBasePath , $ "oauth/token", HttpMethod . Post , Configuration . DefaultHeader ? . ToList ( ) , localVarFormParams . ToList ( ) ) ;
1115+ DocuSignRequest request = PrepareOAuthRequest ( oAuthBasePathParam , $ "oauth/token", HttpMethod . Post , Configuration . DefaultHeader ? . ToList ( ) , localVarFormParams . ToList ( ) ) ;
11161116 DocuSignResponse response = await RestClient . SendRequestAsync ( request , cancellationToken ) ;
11171117
11181118 if ( response . StatusCode >= HttpStatusCode . OK && response . StatusCode < HttpStatusCode . BadRequest )
@@ -1132,7 +1132,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
11321132 /// *RESERVED FOR PARTNERS* RequestJWTApplicationToken
11331133 /// </summary>
11341134 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
1135- /// <param name="oauthBasePath "> Docusign OAuth base path
1135+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
11361136 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
11371137 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
11381138 /// </param>
@@ -1142,12 +1142,12 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
11421142 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
11431143 /// </param>
11441144 /// <returns>The JWT application token</returns>
1145- public OAuth . OAuthToken RequestJWTApplicationToken ( string clientId , string oauthBasePath , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null )
1145+ public OAuth . OAuthToken RequestJWTApplicationToken ( string clientId , string oAuthBasePathParam , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null )
11461146 {
11471147 using ( var cts = new CancellationTokenSource ( ) )
11481148 {
11491149 return TryCatchWrapper ( ( ) => {
1150- var task = Task . Run ( async ( ) => await RequestJWTApplicationTokenAsync ( clientId , oAuthBasePath , privateKeyBytes , expiresInHours , scopes , cts . Token ) ) ;
1150+ var task = Task . Run ( async ( ) => await RequestJWTApplicationTokenAsync ( clientId , oAuthBasePathParam , privateKeyBytes , expiresInHours , scopes , cts . Token ) ) ;
11511151 task . Wait ( ) ;
11521152 return task . Result ;
11531153 } ) ;
@@ -1158,7 +1158,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
11581158 /// *RESERVED FOR PARTNERS* RequestJWTApplicationTokenAsync
11591159 /// </summary>
11601160 /// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
1161- /// <param name="oauthBasePath "> Docusign OAuth base path
1161+ /// <param name="oAuthBasePathParam "> Docusign OAuth base path
11621162 /// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
11631163 /// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
11641164 /// </param>
@@ -1169,7 +1169,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
11691169 /// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
11701170 /// </param>
11711171 /// <returns>The JWT application token</returns>
1172- public async Task < OAuth . OAuthToken > RequestJWTApplicationTokenAsync ( string clientId , string oauthBasePath , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
1172+ public async Task < OAuth . OAuthToken > RequestJWTApplicationTokenAsync ( string clientId , string oAuthBasePathParam , byte [ ] privateKeyBytes , int expiresInHours , List < string > scopes = null , CancellationToken cancellationToken = default )
11731173 {
11741174 string privateKey = Encoding . UTF8 . GetString ( privateKeyBytes ) ;
11751175
@@ -1184,7 +1184,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
11841184
11851185 descriptor . Subject = new ClaimsIdentity ( ) ;
11861186 descriptor . Subject . AddClaim ( new Claim ( "scope" , String . Join ( " " , scopes ) ) ) ;
1187- descriptor . Subject . AddClaim ( new Claim ( "aud" , oauthBasePath ) ) ;
1187+ descriptor . Subject . AddClaim ( new Claim ( "aud" , oAuthBasePathParam ) ) ;
11881188 descriptor . Subject . AddClaim ( new Claim ( "iss" , clientId ) ) ;
11891189
11901190 if ( ! string . IsNullOrEmpty ( privateKey ) )
@@ -1206,7 +1206,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
12061206 { "assertion" , jwtToken }
12071207 } ;
12081208
1209- DocuSignRequest request = PrepareOAuthRequest ( oauthBasePath , $ "oauth/token", HttpMethod . Post , Configuration . DefaultHeader ? . ToList ( ) , localVarFormParams . ToList ( ) ) ;
1209+ DocuSignRequest request = PrepareOAuthRequest ( oAuthBasePathParam , $ "oauth/token", HttpMethod . Post , Configuration . DefaultHeader ? . ToList ( ) , localVarFormParams . ToList ( ) ) ;
12101210 DocuSignResponse response = await RestClient . SendRequestAsync ( request , cancellationToken ) ;
12111211
12121212 if ( response . StatusCode >= HttpStatusCode . OK && response . StatusCode < HttpStatusCode . BadRequest )
0 commit comments