Search code examples
oauth-2.0wso2content-security-policyresponse-headersstrict-transport-security

How to add response header to wso2 authentication endpoints


i'm able to add the response header to all my API except for the wso2 authentication endpoints

https://testorsampletdomain.com/oauth2/authorize

https://testorsampletdomain.com/authenticationendpoint/login.do?

https://testorsampletdomain.com/logincontext?

I need to add strict-transport-security and content-security-policy to response header of authentication endpoints pls help to address the above.


Solution

  • You can configure the custom header filter in the identity server by following the guide here https://github.com/wso2-extensions/identity-carbon-auth-rest#custom-header-filter NOTE: This filter is available after IS-5.11.0 https://github.com/wso2/product-is/issues/9088

    When comes to step 4 of the guide: The custom response headers that you want to add;

    • for the authentication endpoint responses should be added under the application name "authenticationendpoint"

    • for the oauth2 endpoint responses should be added under the application name "oauth2"