Question
· Feb 9, 2023

How could we: "Ćustomize Error Message When Obtaining Token in OAuth2.0 Authorization Server"

Good afternoon! 👋 We would be very grateful if you are kind enough to read and respond to our request 😊.

We need given an Authentication request issued towards our OAuth 2.0 authorization server; that in case of error, the responded message is customized.

Currently if we point from POSTMAN to:
https://[IP]:[Port]/oauth2/token?grant_type=client_credentials&scope=my/scope

Username: Erroneous
Password: Erroneous

We get:
{
    "error": "server_error",
    "error_description": "ERROR #5002: Cache error: <INVALID OREF>zAuthorize+28^OAuth2.Server.Token.1"
}

We would need something like:
{
    "codigo": "Error code 001",
    "descripcion": "No se ha podido obtener el Token"
}

Please could you tell us by which steps, which documentation and which Ensemble classes to customize this error message?

Thank you very much in advance.

So far we have dug into:
Documentation:
    https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

Ensemble Web Production page:
  System > Security Management > OAuth 2.0 Authorization Server Settings - (Security Settings).

        Under the Customization tab.

Ensemble Classes:
    %OAuth2.Server.Authenticate
    %OAuth2.Server.Validate
    %OAuth2.Server.JWT
    %OAuth2.Server.Properties

 

Please could you explain us which steps to follow, in which classes to investigate and which documentation to read to do it? 🤔 Thank you in advance for your time! 🤗
 

Discussion (2)2
Log in or sign up to continue