Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement an OAuth 2.0 Authorization Server?

I understood how to write Running OAuth 2.0 code for the client side.

Using existing Authorization Server, like Google, seems to be not too complicated.

Question is: How to implement my own Authorization Server?

Since many companies have their own User/Privilege system, LDAP based (e.g. Active Directory), etc. - they must have their own Authorization Server.

Is there a framework, libraries, etc. for that? Or do I have to write the code from scratch?

like image 368
Frizz Avatar asked Jul 17 '14 08:07

Frizz


People also ask

What is authorization server in OAuth2?

At its core, an authorization server is simply an engine for minting OpenID Connect or OAuth 2.0 tokens. An authorization server is also used to apply access policies. Each authorization server has a unique issuer URI and its own signing key for tokens to keep a proper boundary between security domains.

How does OAuth2 server work?

It works by delegating user authentication to the service that hosts a user account and authorizing third-party applications to access that user account. OAuth 2 provides authorization flows for web and desktop applications, as well as mobile devices.

What is a OAuth server?

OAuth is an open-standard authorization protocol or framework that describes how unrelated servers and services can safely allow authenticated access to their assets without actually sharing the initial, related, single logon credential.


1 Answers

The best reference is the OAuth 2.0 site. They list the available server libraries that you can use. Currently, the options are:

Java

  • Apache Oltu
  • Spring Security for OAuth
  • Apis Authorization Server (v2-31)
  • Restlet Framework (draft 30)
  • Apache CXF

PHP

  • PHP OAuth2 Server and Demo
  • PHP OAuth 2.0 Auth and Resource Server and Demo
  • PHP OAuth 2.0 (AS with SAML/BrowserID AuthN, with management REST API, see DEMO)

Python

  • Python OAuth 2.0 Provider (see Tutorial)
  • OAuthLib (a generic implementation of the OAuth request-signing logic) is avaliable for Django and Flask web frameworks

Other

  • NodeJS OAuth 2.0 Provider
  • Ruby OAuth2 Server (draft 18)
  • .NET DotNetOpenAuth
  • Erlang Oauth2 Server framework

I would also highly recommend that you read all the documentation available on how the standard works before getting started. There are many parts to OAuth and it can get confusing. At least, that's how I feel.

like image 94
Sid Avatar answered Oct 06 '22 23:10

Sid