OAuth is a service that is complementary to and distinct from
OpenID. OAuth is unrelated to
OATH, which is a reference architecture for authentication, not a standard for authorization. However, OAuth is directly related to
OpenID Connect (OIDC), since OIDC is an authentication layer built on top of OAuth 2.0. OAuth is also unrelated to
XACML, which is an authorization policy standard. OAuth can be used in conjunction with XACML, where OAuth is used for ownership consent and access delegation whereas XACML is used to define the authorization policies (e.g., managers can view documents in their region).
OpenID vis-à-vis pseudo-authentication using OAuth OAuth is an
authorization protocol, rather than an
authentication protocol. Using OAuth on its own as an authentication method may be referred to as pseudo-authentication. The following diagrams highlight the differences between using OpenID (specifically designed as an authentication protocol) and OAuth for authorization. The communication flow in both processes is similar: • (Not pictured) The user requests a resource or site login from the application. • The site sees that the user is not authenticated. It formulates a request for the identity provider, encodes it, and sends it to the user as part of a redirect URL. • The user's browser makes a request to the redirect URL for the identity provider, including the application's request • If necessary, the identity provider authenticates the user (perhaps by asking them for their username and password) • Once the identity provider is satisfied that the user is sufficiently authenticated, it processes the application's request, formulates a response, and sends that back to the user along with a redirect URL back to the application. • The user's browser requests the redirect URL that goes back to the application, including the identity provider's response • The application decodes the identity provider's response, and carries on accordingly. • (OAuth only) The response includes an access token which the application can use to gain direct access to the identity provider's services on the user's behalf. The crucial difference is that in the OpenID
authentication use case, the response from the identity provider is an assertion of identity; while in the OAuth
authorization use case, the identity provider is also an
API provider, and the response from the identity provider is an access token that may grant the application ongoing access to some of the identity provider's APIs, on the user's behalf. The access token acts as a kind of "valet key" that the application can include with its requests to the identity provider, which prove that it has permission from the user to access those APIs. Because the identity provider typically (but not always) authenticates the user as part of the process of granting an OAuth access token, it is tempting to view a successful OAuth access token request as an authentication method itself. However, because OAuth was not designed with this use case in mind, making this assumption can lead to major security flaws.
OAuth and XACML XACML is a policy-based,
attribute-based access control authorization framework. It provides: • An
access control architecture. • A policy language with which to express a wide range of access control policies including policies that can use consents handled / defined via OAuth. • A request / response scheme to send and receive authorization requests. XACML and OAuth can be combined to deliver a more comprehensive approach to authorization. OAuth does not provide a policy language with which to define access control policies. XACML can be used for its policy language. Where OAuth focuses on delegated access (I, the user, grant Twitter access to my Facebook wall), and identity-centric authorization, XACML takes an attribute-based approach which can consider attributes of the user, the action, the resource, and the context (who, what, where, when, how). With XACML it is possible to define policies such as • Managers can view documents in their department • Managers can edit documents they own in draft mode XACML provides more fine-grained access control than OAuth does. OAuth is limited in granularity to the coarse functionality (the scopes) exposed by the target service. As a result, it often makes sense to combine OAuth and XACML together where OAuth will provide the delegated access use case and consent management and XACML will provide the authorization policies that work on the applications, processes, and data. Lastly, XACML can work transparently across multiple stacks (
APIs, web SSO, ESBs, home-grown apps, databases...). OAuth focuses exclusively on HTTP-based apps. == Controversy ==