[keycloak-dev] Federated Identity and Authentication Broker

Pedro Igor Silva psilva at redhat.com
Wed Nov 19 14:27:58 EST 2014


----- Original Message -----
> From: "Bill Burke" <bburke at redhat.com>
> To: keycloak-dev at lists.jboss.org
> Sent: Wednesday, November 19, 2014 4:39:52 PM
> Subject: Re: [keycloak-dev] Federated Identity and Authentication Broker
> 
> 
> 
> On 11/19/2014 1:22 PM, Pedro Igor Silva wrote:
> > Hi,
> >
> >      Would like to start a discussion about how to enable KC as an
> >      Authentication Broker in order to supported Chained Federation and
> >      also Identity Federation. First of all, some background about what
> >      this is all about.
> >
> >      Currently KeyCloak provides two basic types of authentication (correct
> >      me if I'm wrong, please):
> >
> >          1) Local authentication (based on some credential type enabled to
> >          a realm)
> >          2) Social authentication
> >
> >      Local authentication is about authenticating the user locally using
> >      KC's own identity store. Nothing special here. And Social
> >      Authentication which allows users to choose the Social IdP they want
> >      to authenticate with. In this case, the IdP is always one of the
> >      built-in social providers supported by KC such as Facebook, Google,
> >      Twitter, Github and so forth.
> >
> >      When doing social, the user is automatically provisioned in KC
> >      identity store after a successful authentication. The user does not
> >      need to fill a registration form and can access the application very
> >      quickly. During the provisioning some basic information is retrieved
> >      from the social provider such as email, firstname and so forth. These
> >      are very basic information, any other information such as those
> >      related with authorization policies - eg.: roles and groups - must be
> >      defined later via KC's admin console.
> >
> >      Another important characteristic of social authentication is that the
> >      application receives a KC token and not the token that was issued by
> >      the social IdP during the authentication process. If the application
> >      wants to consume resources from the resource provider he was
> >      authenticated it must obtain the access token(again) by itself prior
> >      to invoke the resource provider API. Assuming all those social
> >      providers are based on oAuth 1.0 or 2.0.
> >
> >      That said, the Authentication Broker functionality aims to cover the
> >      same use cases but with a lot of more flexibility on how you setup
> >      identity providers(not only social ones) and the different federation
> >      protocols they may support such as SAML, OpenID, oAuth and so forth.
> >      This is useful when an enterprise is providing services to different
> >      customers(IdP) and does not want to manage many to many
> >      relationships. When using a broker, the authentication steps are
> >      pretty much the same when you are using social authentication, with
> >      important differences on how you support different identity
> >      providers, different federation protocols, how users are provisioned
> >      and how claims and attributes are resolved.
> >
> >      The brokering functionality can be done in two ways depending if the
> >      broker service is acting as a gateway or not. When acting as a
> >      gateway, the broker will respond to the application the same token
> >      issued by the trusted identity provider. For instance, if the user
> >      selects a SAML IdP to authenticate with, the application will receive
> >      a SAML Response. In this case, the application must also be prepared
> >      to handle a specific federation protocol.
> >
> >      However, the broker service can also be used to completely abstract
> >      from the application the protocol used to authenticate an user. In
> >      this case, the application will just receive an ordinary KC token
> >      after a successful authentication.
> >
> >      In both cases, the broker acts as an intermediary where specific
> >      security policies can be applied when users try to authenticate
> >      themselves against a 3rd party IdP. That brings a lot of value when
> >      you think about auditing, authorization and how users are provisioned
> >      when federation of identities is needed. This also allows existing
> >      security infrastructures (eg.: SAML-based infrastructures) to benefit
> >      from KC's support for cloud, rest and mobile use cases.
> >
> >      I think this is enough to start a discussion. I've an initial
> >      discussion with Stian about all that and we agreed that abstract the
> >      protocol from applications should be prioritized. The main reason is
> >      that it makes life easier for applications so they only need to know
> >      about KC tokens and nothing else. However that brings some new
> >      requirements around user provisioning and claim/attribute resolution
> >      or mapping. But that would be another thread.
> >
> 
> Can you elaborate on "abstract the protocol from applications"?  Not
> sure what you mean by that.  IDP federation should be configured at the
> realm level and really has nothing to do with applications.
> 
> I'm really happy that somebody is doing this.  We're getting a real
> impressive feature set!

Sure. What I meant was that the application only knows about KC tokens nothing else. It will always receive a KC token regardless the protocol used to authenticate the user against a 3rd party IdP (saml, oidc, whatever). The example I gave was about an user trying to authenticate against a SAML IdP. In this case, after a successful authentication on the IdP, the IdP will issue a token to KC. Then KC will validate the token, perform trust and security checks, do user provisioning and attribute/claim resolution to finally issue a KC token and redirect the user to the application. If the app is configured to use openid in KC then it will receive a openid token from KC, not saml ...

The other scenario is pretty much the same. The difference is that KC will not issue its own token but just replay the token issued by the 3rd party IdP to the service provider.

I agree that this config goes at the realm level. For instance, to create and enable providers for being used. However, I think we would need some specific configuration for applications as well. Specially when defining default roles, mapping attributes. Another example of application config is when using a OIDC/oAuth IdP. You may want to define scopes per-application.

> 
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
> 


More information about the keycloak-dev mailing list