What is the fastest/easiest way to get an OAuth provider running in Java? Specifically, I need to authorize third-party apps to access certain web services (I'm thinking token authentication using OAuth).
I've been looking at Jersey's OAuth extension, but as mentioned here, it doesn't provide a full-fledged Service Provider.
One of OAuth's key patterns is a resource server. A resource server accepts an access token. If the token is valid, it gives a client access to the resource owner's data. In this example, a client is an app, the resource owner is a user, and the resource server is the Java API you develop.
The app you just wrote, in OAuth 2.0 terms, is a Client Application, and it uses the authorization code grant to obtain an access token from GitHub (the Authorization Server). It then uses the access token to ask GitHub for some personal details (only what you permitted it to do), including your login ID and your name.
There are a few Java libraries out there for OAuth. Specifically, I'd have a look at this one. I haven't used it myself, but there is an example for running an OAuth Service Provider.
There's a list of libraries available on the OAuth website: http://oauth.net/code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With