diff --git a/controllers/token.go b/controllers/token.go index 176aa04e..15973066 100644 --- a/controllers/token.go +++ b/controllers/token.go @@ -16,6 +16,7 @@ package controllers import ( "encoding/json" + "fmt" "time" "github.com/beego/beego/utils/pagination" @@ -460,7 +461,18 @@ func (c *ApiController) IntrospectToken() { } if token != nil { + application, err = object.GetApplication(fmt.Sprintf("%s/%s", token.Owner, token.Application)) + if err != nil { + c.ResponseTokenError(err.Error()) + return + } + if application == nil { + c.ResponseError(fmt.Sprintf(c.T("auth:The application: %s does not exist"), token.Application)) + return + } + introspectionResponse.TokenType = token.TokenType + introspectionResponse.ClientId = application.ClientId } c.Data["json"] = introspectionResponse