Java Code Examples for me.zhyd.oauth.request.AuthRequest#authorize()

The following examples show how to use me.zhyd.oauth.request.AuthRequest#authorize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuthRestApi.java    From mogu_blog_v2 with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value = "获取认证", notes = "获取认证")
@RequestMapping("/render")
public String renderAuth(String source, HttpServletResponse response) throws IOException {
    log.info("进入render:" + source);
    AuthRequest authRequest = getAuthRequest(source);
    String token = AuthStateUtils.createState();
    String authorizeUrl = authRequest.authorize(token);
    Map<String, String> map = new HashMap<>();
    map.put(SQLConf.URL, authorizeUrl);
    return ResultUtil.result(SysConf.SUCCESS, map);
}
 
Example 2
Source File: ThirdLoginController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/render/{source}")
public void render(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
    log.info("第三方登录进入render:" + source);
    AuthRequest authRequest = factory.get(source);
    String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
    log.info("第三方登录认证地址:" + authorizeUrl);
    response.sendRedirect(authorizeUrl);
}
 
Example 3
Source File: ThirdLoginController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/render/{source}")
public void render(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
    log.info("第三方登录进入render:" + source);
    AuthRequest authRequest = factory.get(source);
    String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
    log.info("第三方登录认证地址:" + authorizeUrl);
    response.sendRedirect(authorizeUrl);
}