Class GitHubAuthController

java.lang.Object
com.bytedesk.core.rbac.auth.github.GitHubAuthController

@RestController @RequestMapping("/auth/github") @Description("GitHub OAuth Login") public class GitHubAuthController extends Object
GitHub OAuth Login Documentation: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
  • Field Details

  • Constructor Details

    • GitHubAuthController

      public GitHubAuthController()
  • Method Details

    • authorize

      @GetMapping("/authorize") public org.springframework.http.ResponseEntity<?> authorize(@RequestParam(value="redirectUri",required=false) String redirectUri, @RequestParam(value="state",required=false) String state, @RequestParam(value="scope",required=false) String scope)
    • login

      @PostMapping("/login") @ActionAnnotation(title="auth", action="\u5bc6\u7801\u767b\u5f55", description="Login with GitHub Code") public org.springframework.http.ResponseEntity<?> login(@RequestBody GitHubLoginRequest requestBody, jakarta.servlet.http.HttpServletRequest httpRequest)
      前端在 GitHub 回调页拿到 code 后,POST 到这里换取本地登录态