edu.asu.diging:oauth-tokens

Spring OAuth2 client management.

License

License

GroupId

GroupId

edu.asu.diging
ArtifactId

ArtifactId

oauth-tokens
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

jar
Description

Description

edu.asu.diging:oauth-tokens
Spring OAuth2 client management.
Project URL

Project URL

https://github.com/diging/oauth-tokens
Source Code Management

Source Code Management

https://github.com/diging/oauth-tokens

Download oauth-tokens

How to add to project

<!-- https://jarcasting.com/artifacts/edu.asu.diging/oauth-tokens/ -->
<dependency>
    <groupId>edu.asu.diging</groupId>
    <artifactId>oauth-tokens</artifactId>
    <version>0.4</version>
</dependency>
// https://jarcasting.com/artifacts/edu.asu.diging/oauth-tokens/
implementation 'edu.asu.diging:oauth-tokens:0.4'
// https://jarcasting.com/artifacts/edu.asu.diging/oauth-tokens/
implementation ("edu.asu.diging:oauth-tokens:0.4")
'edu.asu.diging:oauth-tokens:jar:0.4'
<dependency org="edu.asu.diging" name="oauth-tokens" rev="0.4">
  <artifact name="oauth-tokens" type="jar" />
</dependency>
@Grapes(
@Grab(group='edu.asu.diging', module='oauth-tokens', version='0.4')
)
libraryDependencies += "edu.asu.diging" % "oauth-tokens" % "0.4"
[edu.asu.diging/oauth-tokens "0.4"]

Dependencies

compile (9)

Group / Artifact Type Version
org.springframework.data : spring-data-jpa jar
org.hibernate : hibernate-entitymanager jar 5.3.2.Final
org.springframework.security : spring-security-core jar 5.1.5.RELEASE
org.springframework.security.oauth : spring-security-oauth2 jar 2.3.6.RELEASE
org.springframework : spring-context jar
org.springframework : spring-context-support jar
org.springframework : spring-webmvc jar
javax.servlet : javax.servlet-api jar 3.1.0
javax.interceptor : javax.interceptor-api jar 1.2

Project Modules

There are no modules declared in this project.

oauth-tokens

Plugin providing some base code for Spring OAuth providers

oauth-tokens uses Spring Security OAuth2 to provide oauth provider functionality and Spring Data JPA to store data. More precisely, it provides a manager class and controllers to manage OAuth2 clients.

Installation

Include the following plugin your pom.xml.

Usage

To configure oauth-tokens, add a configuration class that implements OAuthTokensConfiguration and set the properties you want to change from the defaults on OAuthTokens.

@Configuration
public class OAuthTokensConfig implements OAuthTokensConfiguration {
    @Override
    public void configure(OAuthTokens arg0) {
        
    }
}

Add a view in views/admin/apps/add.html with a form to add new apps, e.g. using Thymeleaf:

<form action="#" th:action="@{/admin/apps/add}" method="POST" th:object="${appForm}">
  <label>App Name: </label>
  <input th:field="*{name}" class="form-control input-sm"></input>
  <p class="text-danger"><th:errors path="name"/></p>
	
  <label>Description: </label>
  <input th:field="*{description}" class="form-control input-sm"></input>
  <p class="text-danger"><th:errors path="description"/></p>
	
  <button type="submit" class="btn btn-primary">Add</button>
</form>

After a new oauth client has been created, oauth-tokens will add the new client id and secret as clientId and secret into the model.

Make sure to scan the package edu.asu.diging.oauth.tokens for Spring components. The JPA repositories of oauth-tokens are located in edu.asu.diging.oauth.tokens.core.data (to be used with @EnableJpaRepositories). Your entity manager factory bean has to scan edu.asu.diging.oauth.tokens.core.model for model classes.

See the wiki for how to set up the project with Spring OAuth2.

edu.asu.diging

ASU Digital Innovation Group

Versions

Version
0.4