security - OAuth2 in-browser-app use Authorization grant instead of implicit -
we have public api protect using oauth2.
i've been reading on specification/documentation, still have questions implicit grant.
i understand implicit grant used client-only in-browser-(javascript)-apps. less secure , such possibilities should restricted (e.g. read-only access). also, no refresh tokens should issued, , token should not long-lived.
but stopping creator of in-browser-(js)-app use authz grant instead of implicit grant? creator of such app there benefit can more permissions (destructive) stuff, , refresh-token can use new access_tokens when expire. latter ideal because won't have bug users login every often.
this of course problematic because refresh_token, client_id , client_secret compromised way.
so question revolves around this: how can make sure in-browser-only-apps use restricted implicit grant?
before being able connect our api using oauth, client/developer must register client_id, callback_url, client_secret. it's possible me (as api owner) revoke permission if detect kind of behaviour. means i'll have check manually, , periodically?
is there better way?
one option rely on user-agent header client web app cannot influence (it browser sending requests!)
you may consider denying issuing token if cliend_id , client_secrets used in combination user-agent coming browser. may allow client_id in combination browser's user-agent not issue refresh_token , use shorter expiration access_token in such case. (not sure if still technically conform oidc)
Comments
Post a Comment