Posts

Showing posts from May, 2016

Start WSO2 Identity Server 5.1 as windows Service

Prerequisites * Jdk 1.624 or later ,1.7 or 1.8 with JAVA_HOME environmental variable in windows environment. * Yet Another Java Service Wrapper ( YAJSW ) version 11.03 (you can download it from here . Configuring wrapper.conf file in YAJSW   We need to configure wrapper.conf file which is located inside {yajsw-Home} /conf as below. We can just copy and paste the configurations from wrapper.conf file which is located inside {wso2is-5.1.0_Home}/bin/yajsw to wrapper.conf file in {yajsw-Home} /conf. Setting Up Carbon_Home in Windows 7  You can use below steps to configure Carbon_Home 1. Right click on the computer icon 2. Choose properties 3. Click on Advanced Settings link 4. Click Environmental Variables 5. Add a new system variable by providing       Variable name :CARBON_HOME      Variable value :D:\Hasanthi\wso2is-5.1.0 (path to the extracted Identity   Server) Running the product   1. Use windows command prompt and go to bat folder inside  {yajsw-Home} 

Applying CORS Filter to wso2 Identity Server

When we are invoking an endpoint in oauth2 war from a javascript of a web app which is located in a different domain than identity server domain we are getting "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://XXXXXXX is therefore not allowed access." The issue is occurring as the script on your page is running from a specifc domain and would try to request the resource via an XmlHttpRequest or XDomainRequst from a different domain as this is a cross -origin request. In order to get rid of this we need to enable this by sending below header using a custom filter.  Access-Control-Allow-Origin: http: //example.com   (Here  http://example.com is the domain name of where page with that script is hosted) Invoking UserInfo endpoint of wso2 Identity Server from JavaScript We have two possible solutions to apply the CORS header.  1. Customizing OpenIDConnectUserEndpoint.java as below and replacing the oauth

Create Access Token using SAML2 Bearer Grant Type and Invoke APIS in wso2 API Manager

Image
First we need to create an API in wso2 API Manager and obtain the client id and secret. Then we can use travelocity sample application in wso2 Identity server to generate access token. Configure travelocity Sample Application In order to use travelocity sample application we need to change following configurations in travelocity.properties file which is located in  <Tomcat_Home>/webapps/travelocity.com/WEB-INF/classes EnableSAML2Grant=true OAuth2.TokenURL=https://localhost:8244/token (This is the token endpoint of APIM. The APIM is running with a port offset of 1) OAuth2.ClientId=TTAoWMohG0lcO8UmN8CRskDT0uMa (Client Id and Client Secret of API) OAuth2.ClientSecret=tFdgrDb8BNxPkqWoBmTL7rvGBLEa Configure Identity Server to add travelocty application   The AudienceRestriction and the Recipient values we configure here should be equal and the same value shuld be configured as the alias. Configure Identiy Provider in APIM   The public cer