@@ -52,21 +52,7 @@ public async Task<IActionResult> Login([FromBody] AuthenticateRequestDto dto)
5252 {
5353 try
5454 {
55- await SignInUser ( dto ? . AuthToken , false ) ;
56- return Ok ( ) ;
57- }
58- catch ( ArgumentNullException )
59- {
60- return BadRequest ( new { error = "Missing auth_token" } ) ;
61- }
62- }
63-
64- [ HttpPost ( "mobile/login" ) ]
65- public async Task < IActionResult > MobileLogin ( [ FromBody ] AuthenticateRequestDto dto )
66- {
67- try
68- {
69- await SignInUser ( dto ? . AuthToken , true ) ;
55+ await SignInUser ( dto ? . AuthToken ) ;
7056 return Ok ( ) ;
7157 }
7258 catch ( ArgumentNullException )
@@ -82,7 +68,7 @@ public async Task Logout()
8268 await HttpContext . SignOutAsync ( CookieAuthenticationDefaults . AuthenticationScheme ) ;
8369 }
8470
85- private async Task SignInUser ( WebEidAuthToken authToken , bool includeMobileClaims )
71+ private async Task SignInUser ( WebEidAuthToken authToken )
8672 {
8773 if ( authToken == null )
8874 {
@@ -97,17 +83,18 @@ private async Task SignInUser(WebEidAuthToken authToken,bool includeMobileClaims
9783 AddNewClaimIfCertificateHasData ( claims , ClaimTypes . NameIdentifier , certificate . GetSubjectIdCode ) ;
9884 AddNewClaimIfCertificateHasData ( claims , ClaimTypes . Name , certificate . GetSubjectCn ) ;
9985
100- if ( includeMobileClaims )
86+ if ( ! string . IsNullOrEmpty ( authToken . UnverifiedSigningCertificate ) )
10187 {
102- if ( ! string . IsNullOrEmpty ( authToken . UnverifiedSigningCertificate ) )
103- {
104- claims . Add ( new Claim ( "signingCertificate" , authToken . UnverifiedSigningCertificate ) ) ;
105- }
88+ claims . Add ( new Claim (
89+ "signingCertificate" ,
90+ authToken . UnverifiedSigningCertificate ) ) ;
91+ }
10692
107- if ( authToken . SupportedSignatureAlgorithms != null )
108- {
109- claims . Add ( new Claim ( "supportedSignatureAlgorithms" , JsonSerializer . Serialize ( authToken . SupportedSignatureAlgorithms ) ) ) ;
110- }
93+ if ( authToken . SupportedSignatureAlgorithms != null )
94+ {
95+ claims . Add ( new Claim (
96+ "supportedSignatureAlgorithms" ,
97+ JsonSerializer . Serialize ( authToken . SupportedSignatureAlgorithms ) ) ) ;
11198 }
11299
113100 var identity = new ClaimsIdentity ( claims , CookieAuthenticationDefaults . AuthenticationScheme ) ;
0 commit comments