@@ -20,7 +20,7 @@ class Program
2020 private static string _audience = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ;
2121
2222 // Replace this with actual Wallester API URL
23- private static string _apiURL = "http://xxx.wallester.eu/api/ v1/test/ping" ;
23+ private static string _apiURL = "http://xxx.wallester.eu/v1/test/ping" ;
2424
2525 private static string _subject = "api-request" ;
2626
@@ -103,7 +103,7 @@ private static string DoRequest(string requestBody, SigningCredentials signingCr
103103 Console . WriteLine ( "Response is not trusted: " + e ) ;
104104 }
105105 }
106-
106+
107107 return responseString ;
108108 }
109109
@@ -121,17 +121,19 @@ private static void VerifyToken(String token, String responseBodyHash, SecurityK
121121 IssuerSigningKey = wallesterPublicKey ,
122122 ValidateIssuerSigningKey = true
123123 } ;
124-
124+
125125 SecurityToken validatedToken ;
126126 var handler = new JwtSecurityTokenHandler ( ) ;
127127 var claimsPrincipal = handler . ValidateToken ( token , tokenValidationParameters , out validatedToken ) ;
128128
129129 var rbh = claimsPrincipal . FindFirst ( "rbh" ) ;
130- if ( rbh == null ) {
130+ if ( rbh == null )
131+ {
131132 throw new ApplicationException ( "missing response body hash" ) ;
132133 }
133134
134- if ( rbh . Value != responseBodyHash ) {
135+ if ( rbh . Value != responseBodyHash )
136+ {
135137 throw new ApplicationException ( "invalid response body hash: " + rbh . Value ) ;
136138 }
137139
@@ -158,7 +160,7 @@ private static string CreateToken(string requestBodyHash, SigningCredentials sig
158160
159161 var notBefore = DateTime . UtcNow ;
160162 var expires = DateTime . UtcNow . AddMinutes ( 1 ) ;
161- var token = new JwtSecurityToken ( _issuer , _audience , claims , notBefore , expires , signingCredentials ) ;
163+ var token = new JwtSecurityToken ( _issuer , _audience , claims , notBefore , expires , signingCredentials ) ;
162164
163165 var handler = new JwtSecurityTokenHandler ( ) ;
164166 return handler . WriteToken ( token ) ;
0 commit comments