Domino Basic authentication fails when username contains special characters

127 Views Asked by At

I have angular application which receives data from domino. In the angular code, i access domino url via basic authentication.

URL: apidata.nsf/doLoginSuccessAuth?OpenPage
UserName:Vijay Superuser2ö

Authorization: Basic VmlqYXkgU3VwZXJ1c2VyMsO2OkluaXRQYXNzMjAyMw==

enter image description here

When the username contains the special characters, the authentication is not working. I can login with the same username and password successfully via browser. If i remove the special character, basic authentication works just fine.

I have checked below article and the configuration is done as mentioned in the article. https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0082364. I am using Domino 12.0.1.

Do we need to enable any character encoding setting to make this work?

2

There are 2 best solutions below

1
Per Henrik Lausten On BEST ANSWER

You need to encode your Base64 string using ISO-8859-1 (instead of UTF-8).

So for password "initPass2023" your Base64 string should be "VmlqYXkgU3VwZXJ1c2VyMvY6aW5pdFBhc3MyMDIz" instead of "VmlqYXkgU3VwZXJ1c2VyMsO2OmluaXRQYXNzMjAyMw==".

6
Richard Schwartz On

I ran your the Base64 string in your question through a decoder that produces hex output. I was looking to see how the password decoded. But what I saw instead is that it is decoding like this:

Base64 decoded into hex.

I stepped through it looking for the colon character that separates the username and password. The colon is hex 3A. The bytes before the 3A are 55 73 65 72 32 - "user2". The character that should be between the 32 and the 3A ("2:") is completely missing.

Whatever code you are using to construct the Base64 string either has an off-by-one problem that skips the last character of the username, or it doesn't handle the special character at all. Since you're not showing the code, we can't tell which is the case.