Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Query authorization

To authorize a query using the Basic Auth method, add a header to the query with an Authorization key and a value in the format Basic <encoded_login_data>, where the login data is the string <login>:<password> encoded in Base64.

Example in Postman application

Below are the steps performed when sending a request to the api/documents/classes endpoint using Basic Auth authorization in the Postman application:

  1. Add an Authorization header with a value for the example login user and password: Basic dXNlcjpwYXNzd29yZA==.
  2. We send the request and get the result in case:
    1. The login credentials were valid - HTTP 200 and the data in JSON format.



    2. The login credentials were invalid - HTTP 401 and the message "Authorization unsuccessful".

Configure web.xml

If you have problems with Basic Auth query authorization, make sure you have the following entries in your web.xml file:

<filter>
   <filter-name>BasicAuthFilter</filter-name>
   <filter-class>com.suncode.pwfl.web.filter.BasicAuthFilter</filter-class>
</filter>
<filter-mapping>
   <filter-name>BasicAuthFilter</filter-name>
   <url-pattern>/api/*</url-pattern>
</filter-mapping>


  • No labels