- You need to have an auth.sch account.
- Register a new application.
- Include the api to your project.
- Make sure your project has the
jackson-core
and thejackson-databind
dependency.
Spring boot applications will automatically include the jackson dependencies.
AuthSchAPI api = new AuthSchAPI();
api.setClientIdentifier("20 digit number");
api.setClientKey("80 chars key");
Store the api instance in application scope.
api.generateLoginUrl(hashedSessionId, Scope.BASIC, Scope.GIVEN_NAME, Scope.MAIL));
You can also use a list of Scopes.
AuthResponse auth = api.validateAuthentication(code);
It will return a new AuthRespone instance.
AuthResponse auth = api.refreshToken(refreshToken);
ProfileDataResponse profile = api.getProfile(accessToken);
pom.xml
<properties>
<authsch.version>1.0.2</authsch.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>hu.sch</groupId>
<artifactId>authsch</artifactId>
<version>${authsch.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/authsch-${authsch.version}.jar</systemPath>
</dependency>
</dependencies>
You might need to put the authsch-x.x.x.jar
into the WEB-INF/lib
folder.
- beugro.sch (Not released)
Submit your if you have.
"THE BEER-WARE LICENSE" (Revision 42):
<gerviba@gerviba.hu> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. Szabó Gergely