$ cd authorization-server
$ mvn spring-boot:run
$ curl sample:samplesecret@localhost:8888/authorization-server/oauth/token -d grant_type=authorization_code -d client_id=sample -d redirect_uri=http://example.com -d code=kd1Rg1
(code 換成自己取得的)
$ cd resource-server
$ mvn spring-boot:run
$ TOKEN=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTk0Mzg1MjUsInVzZXJfbmFtZSI6InVzZXIiLCJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwianRpIjoiZGI4OTRmMmItYTIyOS00YTQ5LTkyYzgtZDY5NTUwMDVkNzYyIiwiY2xpZW50X2lkIjoic2FtcGxlIiwic2NvcGUiOlsicmVhZCIsImRlbGV0ZSJdfQ.NC8jm1bPL5E0dHT-tuDVeDrMNmVVWL9jmXTJWwZ7TX8cV65bkk6i15u_nEA8xWZTZsA6M5o-1yiUqK_iKFN1_xZgpwR607lisAMIIZod_CqwjQc_Vuhm1BfuR8ByTbBvTh1eZiAmZi2IyQxawodEC9a_peX3gZ6XrDl6xbxb4kXtFLfiWz9jXv4I7zBfHKnlIiDAp6FKHx1Axev416SMmY9NPGt3yX3UY2xYOwX7nLMTr2l__5yGMkzK_JhVVlbgRl0Xu90SwyoKuxaPuAoyQTqUCwYtIKY-0Wx8X0hh2ku6SzYpmT-ViEl8Xj9NXRv4Iq5yuT78_r_WgdKVh9URBw
$ curl -H "Authorization: Bearer $TOKEN" -v localhost:9999/resource-server/