Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Adding claims with non-ascii character to headers fails #26

Closed
davidmarekmsft opened this issue Mar 25, 2021 · 1 comment
Closed

Adding claims with non-ascii character to headers fails #26

davidmarekmsft opened this issue Mar 25, 2021 · 1 comment

Comments

@davidmarekmsft
Copy link
Contributor

If a user has non-ascii characters in their name, the service will throw an exception when trying to add the name claim to response headers in AddResponseHeadersFromClaims.

System.InvalidOperationException: 'Invalid non-ASCII or control character in header: 0x00F6'
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.ThrowInvalidHeaderCharacter(Char ch)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.ValidateHeaderValueCharacters(StringValues headerValues)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseHeaders.AddValueFast(String key, StringValues value)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.System.Collections.Generic.IDictionary<System.String,Microsoft.Extensions.Primitives.StringValues>.Add(String key, StringValues value)
   at OCP.Msal.Proxy.Web.Controllers.AuthController.AddResponseHeadersFromClaims(IEnumerable`1 claims, IHeaderDictionary headers) in C:\Users\x\src\EasyAuthForK8s\OCP.Msal.Proxy.Web\Controllers\AuthController.cs:line 111
@github-actions
Copy link

Message that will be displayed on users' first issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants