File tree Expand file tree Collapse file tree 4 files changed +96
-44
lines changed
authorization-server/src/main
java/com/rabbitmq/authorization_server Expand file tree Collapse file tree 4 files changed +96
-44
lines changed Original file line number Diff line number Diff line change 1+ package com .rabbitmq .authorization_server ;
2+
3+ import org .springframework .beans .factory .annotation .Autowired ;
4+ import org .springframework .security .oauth2 .server .authorization .client .RegisteredClient ;
5+ import org .springframework .security .oauth2 .server .authorization .client .RegisteredClientRepository ;
6+ import org .springframework .web .bind .annotation .GetMapping ;
7+ import org .springframework .web .bind .annotation .RequestParam ;
8+ import org .springframework .web .bind .annotation .RestController ;
9+
10+ @ RestController
11+ public class ClientController {
12+
13+ @ Autowired
14+ private RegisteredClientRepository registeredClientRepository ;
15+
16+ @ GetMapping ("/api/client" )
17+ public RegisteredClient findClientById (@ RequestParam String clientId ) {
18+ return registeredClientRepository .findByClientId (clientId );
19+ }
20+ }
Original file line number Diff line number Diff line change 11server :
2- port : 8080
3-
4- logging :
5- level :
6- org.springframework.security : trace
7-
2+ port : 8443
3+ ssl :
4+ bundle : spring-authorizationserver
5+
86spring :
7+ ssl :
8+ bundle :
9+ jks :
10+ spring-authorizationserver :
11+ key :
12+ alias : server-spring-tls
13+ password : foobar
14+ keystore :
15+ location : ../test/oauth/spring/server_spring.jks
16+ password : foobar
17+ type : PKCS12
918 security :
10- user :
11- name : user
12- password : password
1319 oauth2 :
1420 authorizationserver :
1521 client :
16- oidc-client :
22+ mgt_api_client :
1723 registration :
18- client-id : " oidc-client"
19- client-secret : " {noop}secret"
24+ provider : spring
25+ client-id : mgt_api_client
26+ authorization-grant-types :
27+ - client_credentials
2028 client-authentication-methods :
21- - " client_secret_basic"
22- authorization-grant-types :
23- - " authorization_code"
24- - " refresh_token"
25- redirect-uris :
26- - " http://127.0.0.1:15672/login/oauth2/code/oidc-client"
27- post-logout-redirect-uris :
28- - " http://127.0.0.1:15672/"
29- scopes :
30- - " openid"
31- - " profile"
32- require-authorization-consent : true
29+ - client_secret_basic
30+ require-proof-key : true
31+ scopes :
32+ - openid
33+ - profile
34+ - rabbitmq.tag:management
35+ client-name : mgt_api_client
36+ rabbitmq_client_code :
37+ registration :
38+ provider : spring
39+ client-id : rabbitmq_client_code
40+ authorization-grant-types :
41+ - authorization_code
42+ client-authentication-methods :
43+ - none
44+ redirect-uris :
45+ - " https://localhost:15671/js/oidc-oauth/login-callback.html"
46+ scopes :
47+ - openid
48+ - profile
49+ - rabbitmq.tag:administrator
50+ client-name : rabbitmq_client_code
51+
52+
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- SPRING_DOCKER_IMAGE=pivotalrabbitmq/spring-authorization-server:0.0.2
3+ SPRING_DOCKER_IMAGE=pivotalrabbitmq/spring-authorization-server:0.0.4
44
55ensure_spring () {
66 if docker ps | grep spring & > /dev/null; then
Original file line number Diff line number Diff line change @@ -17,24 +17,36 @@ spring:
1717 type : PKCS12
1818 security :
1919 oauth2 :
20- client :
21- registration :
20+ authorizationserver :
21+ client :
2222 mgt_api_client :
23- provider : spring
24- client-id : mgt_api_client
25- authorization-grant-type : client_credentials
26- scopes :
27- - openid
28- - profile
29- - rabbitmq.tag:management
30- client-name : mgt_api_client
23+ registration :
24+ provider : spring
25+ client-id : mgt_api_client
26+ authorization-grant-types :
27+ - client_credentials
28+ client-authentication-methods :
29+ - client_secret_basic
30+ require-proof-key : true
31+ scopes :
32+ - openid
33+ - profile
34+ - rabbitmq.tag:management
35+ client-name : mgt_api_client
3136 rabbitmq_client_code :
32- provider : spring
33- client-id : rabbitmq_client_code
34- authorization-grant-type : authorization_code
35- redirect-uri : " https://localhost:15671/js/oidc-oauth/login-callback.html"
36- scopes :
37- - openid
38- - profile
39- - rabbitmq.tag:administrator
40- client-name : rabbitmq_client_code
37+ registration :
38+ provider : spring
39+ client-id : rabbitmq_client_code
40+ authorization-grant-types :
41+ - authorization_code
42+ client-authentication-methods :
43+ - none
44+ redirect-uris :
45+ - " https://localhost:15671/js/oidc-oauth/login-callback.html"
46+ scopes :
47+ - openid
48+ - profile
49+ - rabbitmq.tag:administrator
50+ client-name : rabbitmq_client_code
51+
52+
You can’t perform that action at this time.
0 commit comments