package com.jeesite.modules.sso.web;


import com.jeesite.modules.sso.service.SsoOauthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("${adminPath}/token/oauth2")
@Controller
public class GetToken {

    @Autowired
    private SsoOauthService ssoOauthService;
    /***
     * 验证appkey和秘钥
     * @param appKey
     * @param appSecretkey
     * @param responseType  固定值填写code
     * @return
     */
    @RequestMapping("/authorize")
    public String authorize(String appKey, String appSecretkey, String responseType, String redirectUri){
        return "redirect:"+ssoOauthService.authorize(appKey,appSecretkey,responseType,redirectUri);
    }



}
