2

I need to add one parameter to redirect. When authentication fails WSO2 redirects to login page with &authFailure=true&authFailureMsg=login.fail.message request parameters.

I could not add some additional parameter to it by changing org.wso2.carbon.identity.application.authenticator.basicauth.BasicaAuthenticator class messages.

Are there any ways of doing it?

Community
  • 1
  • 1
  • How did you change the `BasicaAuthenticator` class to test? Also, what is the WSO2 IS version you are trying with? – Sajith Dec 26 '20 at 17:13
  • @Sajith I couldn't change it by bundling and replacing jar in components/dropins, adding additional parameter to context.setContextIdIncludedQueryParams in my local authenticator kinda solved my issue. But another problem is that i can't delete this parameter in my BasicAuthenticator.Are there any ways of changing BasicAuthenticator class to remove parameter from context? – Askar Sanbayev Dec 27 '20 at 06:16
  • 1
    @Sajith I added parameter with **context.setContextIdIncludedQueryParams** in my local authenticator and can't delete it **Basicauthenticator**,is it possible to do it? – Askar Sanbayev Dec 28 '20 at 09:24
  • 1
    What do you mean by delete? Do you want to remove some parameters which are added by default? It is possible with this config; https://is.docs.wso2.com/en/latest/develop/customizing-the-authentication-endpoint/#controlling-the-request-parameters-going-to-the-authentication-endpoint – Sajith Dec 28 '20 at 18:34
  • @Sajith it is definitely what i need,i will try it! Thanks! – Askar Sanbayev Dec 28 '20 at 19:01
  • @Sajith Don't you know any ways of invalidating user session in wso2 using tokens? https://stackoverflow.com/questions/65473068/oidc-logout-with-id-token-hint-is-not-working – Askar Sanbayev Dec 28 '20 at 19:01
  • @Sajith where i should add my parameter in my java class,so it will be located after **&authFailure=true&authFailureMsg=login.fail.message** ? – Askar Sanbayev Dec 29 '20 at 05:07
  • Also these parameters can be modified in login.jsp (located in repository/deployment/server/webapps/authenticationendpoint folder) file in a easy way and you may do it without configuring anything else and without redeploy) – Burillodev May 28 '21 at 07:13

2 Answers2

1

Also, in a very easy way, can be modified the login.jsp file located on:

<WSO2_APIM_HOME>/repository/deployment/server/webapps/authenticationendpoint/login.jsp

and you can do it without build any custom authenticator and redeployment. It is hot deploy.

It is also important to modify this file carefully, as it is used by all login flows on the platform

Burillodev
  • 322
  • 1
  • 3
  • 14
0

I could not change BasicAuthenticator.class. Added additional parameters by registering my LocalBasicAuthenticator where functions are the same as BasicAuthenticator but you can add query params and modify it. Then replace jar in components/dropins and change local authentication in your Service Provider.