This is only safe if you trust the organization that provides this service. It looks like they can impersonate the user, your application, and the OAuth provider.
pure js, . OAuth .
, . , , - OAuth API- OAuth / OAuth. , OAuth .
oauth.io , : https://github.com/oauth-io/oauthd