Stage 5 3. Micro Services [online] _day18 studies _04- user authorization methods authorized - authorization implementation method

2.3 Method of Authorization
2.3.1 Add authorization control service resource
1, resource service authorized in order to use the method, first configure resources authorized service control
1) was added spring-cloud-starter-oauth2 dependent.
2) class configuration authorized copy ResourceServerConfig.
3) Copy the public key.



This course management services have been authorized to control

if you want the service to be controlled micro, because curriculum management is the management of back-end services, so it is necessary to verify the token, check user identity
if you write a query publicly available information service, any user can query without landing, it does not need authorization to join controlled

the second step in the method is annotated

before adding the authorization to the authorized configuration class annotated on the approach. @EnableGlobalMethodSecurity (prePostEnabled = true, securedEnabled = true)

then can be added on the authorization method 



An authorization - End



 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11647305.html