File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
dotnet/src/dotnetframework/GxClasses Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public class GxLocation
1616 string _resourceName = "" ;
1717 short _authentication ;
1818 short _authenticationMethod ;
19+ string _accessToken = "" ;
1920 string _authenticationUser = "" ;
2021 string _authenticationRealm = "" ;
2122 string _authenticationPassword = "" ;
@@ -76,6 +77,11 @@ public short AuthenticationMethod
7677 get { return _authenticationMethod ; }
7778 set { _authenticationMethod = value ; }
7879 }
80+ public string AccessToken
81+ {
82+ get { return _accessToken ; }
83+ set { _accessToken = value ; }
84+ }
7985 public string AuthenticationUser
8086 {
8187 get { return _authenticationUser ; }
Original file line number Diff line number Diff line change @@ -371,6 +371,10 @@ public void RestExecute()
371371 httpClient . AddHeader ( "Content-Type" , _contentType ) ;
372372 }
373373 }
374+ if ( this . Location . AuthenticationMethod == 4 && ! String . IsNullOrEmpty ( this . Location . AccessToken ) )
375+ {
376+ httpClient . AddHeader ( "Authorization" , this . Location . AccessToken ) ;
377+ }
374378 string serviceuri = ( ( this . Location . Secure > 0 ) ? "https" : "http" ) + "://" + this . Location . Host ;
375379 serviceuri += ( this . Location . Port != 80 ) ? ":" + this . Location . Port . ToString ( ) : String . Empty ;
376380 serviceuri += "/" + this . Location . BaseUrl . TrimEnd ( '/' ) . TrimStart ( '/' ) + "/" + this . Location . ResourceName ;
You can’t perform that action at this time.
0 commit comments