-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got API Gateway working with auth server now. Auth server has in memo…
…ry http and auth/token from password grant works
- Loading branch information
Rohit Ghatol
committed
Apr 7, 2015
1 parent
125e3f7
commit 6e5cadc
Showing
20 changed files
with
218 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
auth-server/.gradle/2.3/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+300 Bytes
(100%)
auth-server/.gradle/2.3/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>auth-server</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<comment/> | ||
<projects/> | ||
<natures> | ||
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
<arguments/> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
<linkedResources/> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring: | ||
application: | ||
name: auth-server | ||
cloud: | ||
config: | ||
uri: http://localhost:8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
auth-server/src/main/java/com/rohitghatol/microservice/auth/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* | ||
*/ | ||
package com.rohitghatol.microservice.auth; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.authentication.AuthenticationManager; | ||
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; | ||
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; | ||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; | ||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; | ||
|
||
|
||
/** | ||
* The Main Spring Boot Application class. | ||
* | ||
* @author rohitghatol | ||
*/ | ||
|
||
|
||
@Configuration | ||
@ComponentScan | ||
@EnableAutoConfiguration | ||
@EnableEurekaClient | ||
|
||
public class Application { | ||
|
||
/** | ||
* The main method. | ||
* | ||
* @param args the arguments | ||
*/ | ||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
/** | ||
* The Class OAuth2Config. | ||
*/ | ||
@Configuration | ||
@EnableAuthorizationServer | ||
protected static class OAuth2Config extends AuthorizationServerConfigurerAdapter { | ||
|
||
/** The authentication manager. */ | ||
@Autowired | ||
private AuthenticationManager authenticationManager; | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter#configure(org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer) | ||
*/ | ||
@Override | ||
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { | ||
endpoints.authenticationManager(authenticationManager); | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter#configure(org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer) | ||
*/ | ||
@Override | ||
public void configure(ClientDetailsServiceConfigurer clients) throws Exception { | ||
clients.inMemory() | ||
.withClient("client") | ||
.authorizedGrantTypes("client_credentials","refresh_token", "password") | ||
.authorities("ROLE_CLIENT") | ||
.scopes("read") | ||
.resourceIds("paywize") | ||
.secret("secret"); | ||
} | ||
} | ||
|
||
} |
Binary file modified
BIN
+0 Bytes
(100%)
task-webservice/.gradle/2.3/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+77.1 KB
(110%)
task-webservice/.gradle/2.3/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
task-webservice/.gradle/2.3/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified
BIN
+2.95 KB
(110%)
task-webservice/.gradle/2.3/taskArtifacts/taskArtifacts.bin
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters