Skip to content

Commit

Permalink
Release 1.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hzalaz committed Dec 20, 2016
1 parent 8e5483a commit 258f6bc
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 356 deletions.
72 changes: 72 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Change Log

## [1.0.0-rc.1](https://github.com/auth0/java-jwt/tree/1.0.0-rc.1) (2016-12-19)

Auth0 integration with Spring Security to add authorization to your API using JWTs

## Download

Get Auth0 Spring Security API using Maven:

```xml
<dependency>
<groupId>com.github.auth0</groupId>
<artifactId>auth0-spring-security-api</artifactId>
<version>1.0.0-rc.1</version>
</dependency>
```

or Gradle:

```gradle
compile 'com.auth0.github:auth0-spring-security-api:1.0.0-rc.1'
```

## Usage

Inside a `WebSecurityConfigurerAdapter` you can configure your api to only accept `RS256` signed JWTs

```java
@EnableWebSecurity
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
JwtWebSecurityConfigurer
.forRS256("YOUR_API_AUDIENCE", "YOUR_API_ISSUER")
.configure(http);
}
}
```

or for `HS256` signed JWTs

```java
@EnableWebSecurity
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
JwtWebSecurityConfigurer
.forHS256WithBase64Secret("YOUR_API_AUDIENCE", "YOUR_API_ISSUER", "YOUR_BASE_64_ENCODED_SECRET")
.configure(http);
}
}
```


Then using Spring Security `HttpSecurity` you can specify which paths requires authentication

```java
http.authorizeRequests()
.antMatchers("/api/**").fullyAuthenticated();
```

and you can even specify that the JWT should have a single or several scopes

```java
http.authorizeRequests()
.antMatchers(HttpMethod.GET, "/api/users/**").hasAuthority("read:users");
```
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@

## Download

Get Auth0 Spring Security API via [JitPack](https://jitpack.io):
Get Auth0 Spring Security API using Maven:

```xml
<dependency>
<groupId>com.github.auth0</groupId>
<artifactId>auth0-spring-security-api</artifactId>
<version>0.0.1</version>
<version>1.0.0-rc.1</version>
</dependency>
```

or Gradle:

```gradle
compile 'com.auth0.github:auth0-spring-security-api:0.0.1'
compile 'com.auth0.github:auth0-spring-security-api:1.0.0-rc.1'
```

> Remember to add JitPack repositories
## Usage

Inside a `WebSecurityConfigurerAdapter` you can configure your api to only accept `RS256` signed JWTs
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath "gradle.plugin.com.auth0.gradle:oss-library:0.2.11"
classpath "gradle.plugin.com.auth0.gradle:oss-library:0.3.1"
}
}

Expand Down
23 changes: 11 additions & 12 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ oss {

developers {
auth0 {
displayName = "Auth0"
email = "[email protected]"
displayName = 'Auth0'
email = '[email protected]'
}
lbalmaceda {
displayName = "Luciano Balmaceda"
email = "[email protected]"
displayName = 'Luciano Balmaceda'
email = '[email protected]'
}
hzalaz {
displayName = "Hernan Zalazar"
email = "[email protected]"
displayName = 'Hernan Zalazar'
email = '[email protected]'
}
}

Expand Down Expand Up @@ -58,12 +58,11 @@ jacocoTestReport {

test {
testLogging {
events "passed", "skipped", "failed", "standardError"
exceptionFormat "short"
events 'passed', 'skipped', 'failed', 'standardError'
exceptionFormat 'short'
}
}

task clean(type: Delete) {
delete rootProject.buildDir
delete 'CHANGELOG.md.release'
}
clean.doFirst {
new File('CHANGELOG.md.release').delete()
}
55 changes: 0 additions & 55 deletions scripts/bintray.gradle

This file was deleted.

113 changes: 0 additions & 113 deletions scripts/maven.gradle

This file was deleted.

Loading

0 comments on commit 258f6bc

Please sign in to comment.