[openstack-dev] [horizon][keystone] Getting Auth Token from Horizon when using Federation

Martin Millnert martin at millnert.se
Thu May 12 09:38:09 UTC 2016


Hi Dolph,

On Mon, 2016-04-18 at 17:50 -0500, Dolph Mathews wrote:
> 
> On Mon, Apr 18, 2016 at 11:34 AM, Martin Millnert <martin at millnert.se>
> wrote:
>         Hi,
>         
>         we're deploying Liberty (soon Mitaka) with heavy reliance on
>         the SAML2
>         Federation system by Keystone where we're a Service Provider
>         (SP).
>         
>         The problem in this situation is getting a token for direct
>         API
>         access.(*)
>         
>         There are conceptually two methods to use the CLI:
>          1) Modify ones (each customer -- in our case O(100)) IdP to
>         add support
>         for a feature called ECP(**), and then use keystoneauth with
>         SAML2
>         plugin,
>          2) Go to (for example) "Access & Security / API Access / View
>         Credentials" in Horizon, and check out a token from there.
> 
> 
> With a default configuration, this token would only last a short
> period of time, so this would be incredibly repetitive (and thus
> tedious).

Indeed.

> So, I assume you mean some sort of long-lived API tokens?

Right.

> API tokens, including keystone's UUID, PKI, PKIZ, and Fernet tokens
> are all bearer tokens, so we force a short lifetime by default,
> because there are always multiple parties capable of compromising the
> integrity of a token. OAuth would be a counter example, where OAuth
> access tokens can (theoretically) live forever.

This does sound very interesting. As long as the end user gets something
useful to plug into the openstack auth libraries/APIs, we're home free
(modulo security considerations, etc).

>         2) isn't implemented. 1) is a complete blocker for many
>         customers.
>         
>         Are there any principal and fundamental reasons why 2 is not
>         doable?
>         What I imagine needs to happen:
>           A) User is authenticated (see *) in Horizon,
>           B) User uses said authentication (token) to request another
>         token from
>         Keystone, which is displayed under the "API Access" tab on
>         "Access &
>         Security".
> 
> 
> The (token) here could be an OAuth access token.

Will look into this (also as per our discussion in Austin).

The one issue that has appeared in our continued discussions at home, is
the contrast against "service user accounts", that seems a relatively
prevalent/common among deployers today, which basically use
username/password as the api key credentials, e.g. the authZ of the
issued token:

If AdminNameless is Domain Admin in their domain, won't their OAuth
access token yield keystone tokens with the same authZ as they otherwise
have?

My presumptive answer being 'yes', brought me to the realization that,
if one wants to avoid going the way of "service user accounts" but still
reduce authZ, one would like to be able to get OAuth access tokens for a
specific project, with a specific role (e.g. "user", or [project-]admin)
and the authZ this entails. This would keep the traceability, which is
one of the main issues with non-personal accounts.

How feasible is this last bit?


In general, the primary use case is:
 - I as a user of openstack on my personal computer retrieve a token to
manage openstack client operations without the need of storing my
Federation-username/password in local config (nor typing the password in
on the keyboard).

An extended use case definition of this being:
 - I as a user of openstack can provision an automated system with these
credentials, that can continue to operate as an openstack client for a
very long time without maintenance (i.e., either token renewal or
VeryLongLifetime).

Best,
Martin




More information about the OpenStack-dev mailing list