OAuth - Value cannot be null or empty. Parameter name: code

Dear Markus/Experts,

I am trying to test OneIM API via Postman and over the postman while trying to use the OAuth Module as per documentation and passing the OAuth string with required values in the body of my API Call, getting the below error as shown below.

Can someone please advise if I am doing anything wrong

 [
{
"id": "OAuth",
"caption": "OAuth 2.0 / OpenID Connect",
"authTemplate": "Module=OAuth;(OAuth2Code)Code;(Hidden)AppUrl;(Hidden)ClientId;(Hidden)Nonce;(Hidden)RedirectUri",
"passwordBased": false,
"isDefault": false
}
]

2023-05-02 11:07:54.0524 ERROR (ObjectLog Global) : [810284] Failed to authenticate user.
[System.ArgumentException] Value cannot be null or empty.
Parameter name: code
System.AggregateException: One or more errors occurred. ---> VI.Base.ViException: Failed to authenticate user. ---> System.ArgumentException: Value cannot be null or empty.
Parameter name: code
at QER.OAuthAuthentifier.OAuth.<_GetTokenAsync>d__30.MoveNext()

Kindly assist.

Regards,

Debasis

Parents Reply
  • Hi Markus, 

    I have referred the RSTS documentation and referring the same able to generate Authorization Code to pass in the body of OAuth Authentication Module of OneIM via PostMan tool i.e.

    "authTemplate": "Module=OAuth;(OAuth2Code)Code;(Hidden)AppUrl;(Hidden)ClientId;(Hidden)Nonce;(Hidden)RedirectUri",

    But receiving this error when tried via PostMan while making POST call for BaseURL/auth/apphost URI

    Failed to authenticate user using OAuth2/Open ID Connect. VI.Base.ViException: Invalid access token. ---> Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: IDX10504: Unable to validate signature, token does not have a signature: '[PII is hidden by default. Set the 'ShowPII' flag in IdentityModelEventSource.cs to true to reveal it.]'.

    Also for your information, we have only Windows Authentication enabled at IIS end for the AppServer instance, that's why in the authorization of PostMan Tool I am using NLTM Authentication(Beta) and passing the credentials for Windows user with which the Application Pool is configured and in the request body passing the OAuth module for auth/apphost URI POST call.

    is this the correct approach and if you could suggest or give some guidance on the error, that would be really helpful.

Children