· 7 years ago · Jan 11, 2018, 12:32 PM
1package com.example.springoauthdemo;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
6
7@SpringBootApplication
8@EnableOAuth2Sso
9public class SocialApplication {
10
11 public static void main(String[] args) {
12 SpringApplication.run(SocialApplication.class, args);
13 }
14}
15
16security:
17 oauth2:
18 client:
19 clientId: 55bb61f1-4384-4939-9cd0-fa7d76af9a0c
20 clientSecret: fdUjegFlCJjnD778RUSuS4SqMRey4IKVDOkadi4hjN6YbhC1xCInxoxobf-a-p-po8rt1wfZM2BPqJHpcZ-FGs
21 accessTokenUri: https://nam.example.com/nidp/oauth/nam/token
22 userAuthorizationUri: https://nam.example.com/nidp/oauth/nam/authz
23 tokenName: oauth_token
24 authenticationScheme: query
25 clientAuthenticationScheme: form
26 resource:
27 userInfoUri: https://localhost:8443/index.html
28 #userInfoUri: https://nam.example.com/nidp/oauth/nam/userinfo
29
30server:
31 port: 8443
32 ssl:
33 enabled: true
34 key-alias: tomcat-localhost
35 key-password: changeit
36 key-store: classpath:keystore.jks
37 key-store-provider: SUN
38 key-store-type: JKS
39 key-store-password: changeit