Custom REST interface

Hi,

I need to implement a custom REST interface that complies to the SCIM protocol. This protocol uses the same OAuth 2.0 Bearer token approach but the calls, messages and return codes differ from the default Cuba REST interface.

Getting the calls in place shouldn’t be too hard but handling none-entity defined JSON messages and custom return codes seems a lot harder.

What general approach would I need to take to get this implemented?

Regards,
-b

Hi,
Sorry, I didn’t get your question. Could you clarify?

Hi Max,

Thank you for your follow-up. I will try to make things more clear.

Basically, I need to implement a REST interface that needs to comply to a a standard in terms of method names, data formats, return codes etc… This standard is called the SCIM protocol. As you might see it describes a REST interface to manage user account information from a central IDP towards the application (as service provider).

Luckily, this REST interface has a lot in common with the standard Cuba REST interface but the data formats differ (although in JSON, but not matching entity-formats used within the platform). Also, return codes are different.

I know how to implement a REST method but is there any general approach that I could follow to handle the different JSON data and return codes?

For example, as this interface deals with user (account) information, I cannot use the built-in sec$User objects but need to transform them into the required format, and visa versa.

Any ideas / suggestions are appreciated.

Regards,
-b

As I understand you need to create your own Spring MVC controllers and use standard features of Spring MVC: return POJOs with the required data that will be transformed to JSON using standard Spring MVC mechanisms, use ResponseEntity if you need to set response status, etc. There won’t be any CUBA-specific in this.

1 Like

Hi Max,

Thanks - that is a way forward and I just didn’t know to what extend the Cuba platform could be used.

Regards,
-b