Add /api/oauth/token API.

This commit is contained in:
Yang Luo
2021-03-14 00:08:59 +08:00
parent 85523fa9d4
commit 202a94a8e5
5 changed files with 45 additions and 6 deletions

View File

@ -68,3 +68,14 @@ func (c *ApiController) DeleteToken() {
c.Data["json"] = object.DeleteToken(&token)
c.ServeJSON()
}
func (c *ApiController) GetOAuthToken() {
applicationId := c.Input().Get("app_id")
grantType := c.Input().Get("grant_type")
clientId := c.Input().Get("client_id")
clientSecret := c.Input().Get("client_secret")
scope := c.Input().Get("scope")
c.Data["json"] = object.GetOAuthToken(applicationId, grantType, clientId, clientSecret, scope)
c.ServeJSON()
}