title: Can I change the role after the authentication is successful?
body: <p>I successfully passed Github authentication with Spring Security OAuth2. However, the user role obtained through Github is USER_ROLE. </p>
  
  <p>So I was wondering if I could modify the corresponding role by judging Github user information obtained after the authorization was successful in order to control the user's permissions.</p>
  
  <p>For example, getPrincipal () to get a unique "name". Then modify the role by "name" (such as "ADMIN"). Finally, use @PreAuthorize ("hasRole ('ROLE_ADMIN')") to control permissions.</p>
  
  <p>Or are there any other better solutions? I want to integrate Github's OAuth2 authorization and role-based rights management in this application.</p>