Git Product home page Git Product logo

authsch-java-api's Introduction

AuthSch Java API

Coverage: 80.3% Version: 1.0.2 BEER-WARE

Usage

Getting started

  • 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 the jackson-databind dependency.

Spring boot applications will automatically include the jackson dependencies.

Initialize

    AuthSchAPI api = new AuthSchAPI();
    api.setClientIdentifier("20 digit number");
    api.setClientKey("80 chars key");

Store the api instance in application scope.

Generate url example

    api.generateLoginUrl(hashedSessionId, Scope.BASIC, Scope.GIVEN_NAME, Scope.MAIL));

You can also use a list of Scopes.

Validate code and get tokens

    AuthResponse auth = api.validateAuthentication(code);

Refresh the token

It will return a new AuthRespone instance.

    AuthResponse auth = api.refreshToken(refreshToken);

Get profile data

    ProfileDataResponse profile = api.getProfile(accessToken);

Maven

Compiled JAR

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.

List of projects

  • beugro.sch (Not released)

Submit your if you have.

License

"THE BEER-WARE LICENSE" (Revision 42):

<[email protected]> 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

authsch-java-api's People

Contributors

gerviba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.