Mutual Authenticator
SSL authentication :- 1 way SSL authentication
Mutual SSL authenticaion :- 2 way SSL authentication
Mutual SSL authentication refers two parties authentication each other.This is the certificate based authentication process and each party should provide their digital certificate for authentication.
Steps in mutual authentication
I'm giving you the steps to test mutual ssl authentication with wso2 IS and soapui
Step 1 :-
You have to download wso2 identity Server 5.0 from here and apply service pack as instructions given in readme file in service pack.
Step 2 :-
You have to uncomment below lines in [IS_HOME]/repository/conf/security/authenticators.xml
Step 3 :-
Go to <IS_Home>/repository/conf/tomcat/catelina-server.xml and change the clientAuth property.
clientAuth = "true"
Expect two-way SSL authentication for each and every request.
when you make clientAuth attribute to true, you cannot access server from web browser.you can see only the blank page. But two-way ssl authentication is working fine.
clientAuth = "want"
Expect two-way SSL authentication optional.
When you required to access IS from web browser, you have to make clientAuth attribute 'want'.
Step 4 :-
a ) Please download latest service pack for IS here (This is built using latest source).
b ) Extract downloaded file and go to <WSO2-IS-5.0.0-SP01>/resources/dropins folder.
c ) Copy org.wso2.carbon.identity.authenticator.mutualssl_4.2.0.jar file in to dropins folder in [IS_HOME]/repository/components and restart the server.
Step 5 :-
Extract WSO2 public certificate from <IS_Home>/repository/resources/security/wso2carbon.jks and add it to client’s trust store.Add client’s public certificate to the product trust store
You can find it here <IS_Home>/repository/resources/security/client-truststore.jks.
Step 6 :-
If you use soapui as a client, you can add same certificate to soapui
i ) Click preferences button, then you will get a window as below. then you have to click SSL Setting tab and import wso2carbon.jks file to keyStore.
ii ) You have to provide a password and click ok button
password should be 'wso2carbon' for above certificate. if you generated a certificate using keytool, you have to provide a password which you used when you are generating the certificate.
Step 7 :-
Now you have completed the setup. you can choose a admin service and send a request with a username in the header. You will get a response without giving username and password.
Sample soap header
SSL authentication :- 1 way SSL authentication
Mutual SSL authenticaion :- 2 way SSL authentication
Mutual SSL authentication refers two parties authentication each other.This is the certificate based authentication process and each party should provide their digital certificate for authentication.
Steps in mutual authentication
- A client requests access to a protected resource.
- The server presents its certificate to the client.
- The client verifies the server’s certificate.
- If successful, the client sends its certificate to the server.
- The server verifies the client’s credentials.
- If successful, the server grants access to the protected resource requested by the client.
Step 1 :-
You have to download wso2 identity Server 5.0 from here and apply service pack as instructions given in readme file in service pack.
Step 2 :-
You have to uncomment below lines in [IS_HOME]/repository/conf/security/authenticators.xml
<!-- Authenticator Configurations for MutualSSLAuthenticator --> <Authenticator name="MutualSSLAuthenticator" disabled="false"> <Priority>5</Priority> <Config> <Parameter name="UsernameHeader">UserName</Parameter> <Parameter name="WhiteListEnabled">false</Parameter> <Parameter name="WhiteList"/> </Config> </Authenticator>
Step 3 :-
Go to <IS_Home>/repository/conf/tomcat/catelina-server.xml and change the clientAuth property.
clientAuth = "true"
Expect two-way SSL authentication for each and every request.
when you make clientAuth attribute to true, you cannot access server from web browser.you can see only the blank page. But two-way ssl authentication is working fine.
clientAuth = "want"
Expect two-way SSL authentication optional.
When you required to access IS from web browser, you have to make clientAuth attribute 'want'.
Step 4 :-
a ) Please download latest service pack for IS here (This is built using latest source).
b ) Extract downloaded file and go to <WSO2-IS-5.0.0-SP01>/resources/dropins folder.
c ) Copy org.wso2.carbon.identity.authenticator.mutualssl_4.2.0.jar file in to dropins folder in [IS_HOME]/repository/components and restart the server.
Step 5 :-
Extract WSO2 public certificate from <IS_Home>/repository/resources/security/wso2carbon.jks and add it to client’s trust store.Add client’s public certificate to the product trust store
You can find it here <IS_Home>/repository/resources/security/client-truststore.jks.
Step 6 :-
If you use soapui as a client, you can add same certificate to soapui
i ) Click preferences button, then you will get a window as below. then you have to click SSL Setting tab and import wso2carbon.jks file to keyStore.
ii ) You have to provide a password and click ok button
password should be 'wso2carbon' for above certificate. if you generated a certificate using keytool, you have to provide a password which you used when you are generating the certificate.
Step 7 :-
Now you have completed the setup. you can choose a admin service and send a request with a username in the header. You will get a response without giving username and password.
Sample soap header
<soapenv:Header> <m:UserName xmlns:m="http://mutualssl.carbon.wso2.org" soapenv:mustUnderstand="0">admin</m:UserName> </soapenv:Header>
Comments
Post a Comment