simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
708 stars 92 forks source link

Returning 403 status code by the GET, DELETE, POST, PATCH, PUT user endpoints #516

Closed alexander-durovich-swi closed 1 year ago

alexander-durovich-swi commented 1 year ago

Hello,

The current implementation of Internal[GET/DELETE/ADD/PATCH/UPDATE] methods in BaseApiController doesn't allow to return 403 status code. Is it possible to add such possibility, please? (Our provisioning service calls other internal services, and in some cases we should return 403 status code got from these internal services)

Is it possible to add the customizable possibility to return any status code?

Thank you in advance. Best Regards, Alex

simpleidserver commented 1 year ago

Some modifications have been made in the master branch.

As a developer, you can create and inherits one of the following class :

Override the method Handle. This function returns a result of type GenericResult<T>.

You can return custom error message like this :

return GenericResult<SCIMRepresentation>.Error(System.Net.HttpStatusCode.InternalServerError, "errorMessage", "scimType")
alexander-durovich-swi commented 1 year ago

Hello,

Ok, I see, thank you very much!

Best Regards, Alex