Wednesday, August 31, 2016

Running AspectJ (AOP) without Spring!

  • Just make sure you have below dependencies and the plugin available in your pom.xml.
  • Build the project
  • Run your main class
  • You are done!

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.2</version>
</dependency>


<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<complianceLevel>1.7</complianceLevel>
<source>1.7</source>
<target>1.7</target>
<complianceLevel>1.7</complianceLevel>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Saturday, August 6, 2016

Adding an ldap attribute to the local WSO2 IS servers

1.      In the directory IS/repository/data/org.wso2.carbon.directory/schema/ou=schema/cn=inetorgperson/ou=attributetypes add the ldif file with the given content and file name
       FileName: m-oid=2.16.840.1.113730.3.1.13.ldif
       Content:
                      version: 1
                      dn: m-oid=2.16.840.1.113730.3.1.13,ou=attributeTypes,cn=inetorgperson,ou=schema
                      createtimestamp: 20090818022732Z
                      m-singlevalue: TRUE
                      m-obsolete: FALSE
                      m-description: RFC2798: password policy details storage
                      m-usage: USER_APPLICATIONS
                      creatorsname: uid=admin,ou=system
                      m-collective: FALSE
                      m-oid: 2.16.840.1.113730.3.1.13
                      entrycsn: 20090818052732.318000Z#000000#000#000000
                      m-substr: caseIgnoreSubstringsMatch
                      m-nousermodification: FALSE
                      m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
                      objectclass: metaAttributeType
                      objectclass: metaTop
                      objectclass: top
                      m-name: passwordPolicyDetails
                      m-equality: caseIgnoreMatch 
2.      In IS/repository/data/org.wso2.carbon.directory/schema/ou=schema/cn=inetorgperson/ou=objectclasses edit the m-oid=2.16.840.1.113730.3.2.2.ldif file and add the below line: 
                       m-may: passwordPolicy
3.      Add a claim entry in claim-config.xml
4.      Add a claim mapping in the UI

Cheers,
RK