Example: Custom authentication for REST services

Previous Next

USoft provides different authentication schemes. It also allows you to create your own custom authentication. REST services in USoft Service Definer use the Java Jersey Framework. This framework provides a set of features that you can use in Service Definer to extend current functionality. One of the features is the possibility of adding filters to a REST request. By defining a REST request filter, you can add an authentication check before the method is executed. Check Java and Jersey Framework documentation for more explanation on filters.

This example shows how you can create a functional type for a Jersey filter, to allow custom token authentication using a custom HTTP header (API-Token) for sending the authentication token.

This example assumes that you already have a custom REST service and this service is exposed by a Server. For details on how to do these 2 things, step out to help topic "Setting up your own REST service ". Your custom REST service will probably need USoft credentials to connect to the USoft Rules Service. Use anonymous authentication with a user name and a password to provide USoft credentials.

 

 

collapseCreate a functional type based on the Jersey filter class
collapseCreate a service for authentication check
collapseTest your custom authentication in POSTMAN

 

 

See also

Functional types

Custom functional types