feat: bearer access token includes tokenid and subject (#62)
This commit is contained in:
parent
49324646d7
commit
9943f20215
5 changed files with 12 additions and 11 deletions
|
@ -73,12 +73,12 @@ func CreateAccessToken(ctx context.Context, authReq TokenRequest, accessTokenTyp
|
|||
token, err = CreateJWT(creator.Issuer(), authReq, exp, id, creator.Signer())
|
||||
return
|
||||
}
|
||||
token, err = CreateBearerToken(id, creator.Crypto())
|
||||
token, err = CreateBearerToken(id, authReq.GetSubject(), creator.Crypto())
|
||||
return
|
||||
}
|
||||
|
||||
func CreateBearerToken(id string, crypto Crypto) (string, error) {
|
||||
return crypto.Encrypt(id)
|
||||
func CreateBearerToken(tokenID, subject string, crypto Crypto) (string, error) {
|
||||
return crypto.Encrypt(tokenID + ":" + subject)
|
||||
}
|
||||
|
||||
func CreateJWT(issuer string, authReq TokenRequest, exp time.Time, id string, signer Signer) (string, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue