security - How to persist OAuth 2 refresh tokens -
security - How to persist OAuth 2 refresh tokens -
can't find guidelines best way implement persistence of oauth 2 refresh tokens , mutual sentiment should stored , how.
though there very totorial taiseer joudeh oauth authorization in asp.net web api. refreshtokens table article:
where: id - hash of unique token identifier, subject - user name, clientid - applicatation identifier, protectedticket - serialized access token.
i prove or subvert decisions made there help of community. here concerns:
why should persist short-lived access_token? far can think of 2 reasons agains approach. first, potentially security threat when keeping user's access tickes anywhere, waiting grab them, , reuse unsuspicious resource server (remember, should utilize same algorithm serilize/deserialize keys). second, have care updating persisted tickets 1 time decide alter part of serialization algorithm. so, why don't create new tickets in runtime 1 time we've verified client_id
, refresh_token
instead of reading , deserializing database?
how access_token should encrypted, if should persist it? salt + sha2 on serialized ticket job or there improve way?
why hash refresh_token id? kinds of attacks protects? , won't more secure if we'd send hashed keys refresh_token
while keeping real key in database? way brute-force attack on refresh_token (guessing refresh token of random user) have guess hashing algorithm well.
i seek clarify points more:
1 & 2 - if on source code context.serializeticket
here notice protected ticket encrypted using default dpapi depends on server machinekey encryption. if grab db can't unless have machinekey.
3 - if dba has access table , can see the plain refresh token identifiers can simple obtain new access token using refresh token identifier using grant_type (refresh_token)
security authentication oauth oauth-2.0 access-token
Comments
Post a Comment