/usr/lib/python2.6/site-packages/keystoneauth1/extras/_saml2/v3
Edit: /usr/lib/python2.6/site-packages/keystoneauth1/extras/_saml2/v3/adfs.pyc (16295B)
Ņō
7
Wc
@ s
d d k Z d d k Z d d k l Z d d k l Z d d k l Z d d k l Z d d k l
Z
d e
i f d YZ d S( iĸĸĸĸN( t etree( t urllib( t access( t
exceptions( t baset Passwordc B s· e Z d Z d Z h d d 6Z h d d 6Z h d d 6d d 6d d
6Z h d d 6d d 6Z d
Z d Z d Z
d d Z d Z d Z
d Z d Z d Z d Z RS( s1 Authentication plugin for Microsoft ADFS2.0 IdPs.ix s# application/soap+xml; charset=utf-8s Content-Types! application/x-www-form-urlencodeds' http://www.w3.org/2003/05/soap-envelopet ss$ http://www.w3.org/2005/08/addressingt asR http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdt us0 http://docs.oasis-open.org/ws-sx/ws-trust/200512t tsZ /s:Envelope/s:Body/t:RequestSecurityTokenResponseCollection/t:RequestSecurityTokenResponsec
K sD t t | i d | d | d | d | d | d | | | _ d S( sô Constructor for ``ADFSPassword``.
:param auth_url: URL of the Identity Service
:type auth_url: string
:param identity_provider: name of the Identity Provider the client
will authenticate against. This parameter
will be used to build a dynamic URL used to
obtain unscoped OpenStack token.
:type identity_provider: string
:param identity_provider_url: An Identity Provider URL, where the SAML2
authentication request will be sent.
:type identity_provider_url: string
:param service_provider_endpoint: Endpoint where an assertion is being
sent, for instance: ``https://host.domain/Shibboleth.sso/ADFS``
:type service_provider_endpoint: string
:param username: User's login
:type username: string
:param password: User's password
:type password: string
t auth_urlt identity_providert identity_provider_urlt usernamet passwordt protocolN( t superR t __init__t service_provider_endpoint( t selfR
R R R R
R R t kwargs( ( sJ /tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/extras/_saml2/v3/adfs.pyR / s
c C s7 y t | i SWn t j
o n Xt | i i S( sŲ Check if cookie jar is not empty.
keystoneauth1.session.Session object doesn't have a cookies attribute.
We should then try fetching cookies from the underlying
requests.Session object. If that fails too, there is something wrong
and let Python raise the AttributeError.
:param session
:returns: True if cookie jar is nonempty, False otherwise
:raises AttributeError: in case cookies are not find anywhere
( t boolt cookiest AttributeErrort session( R R ( ( sJ /tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/extras/_saml2/v3/adfs.pyt _cookiesS s
s %Y-%m-%dT%H:%M:%S.%fZc C sV t i i } | t i d | i } g } | | f D] } | | i | q9 ~ S( sð Calculate created and expires datetime objects.
The method is going to be used for building ADFS Request Security
Token message. Time interval between ``created`` and ``expires``
dates is now static and equals to 120 seconds. ADFS security tokens
should not be live too long, as currently ``keystoneauth1``
doesn't have mechanisms for reusing such tokens (every time ADFS authn
method is called, keystoneauth1 will login with the ADFS instance).
:param fmt: Datetime format for specifying string format of a date.
It should not be changed if the method is going to be used
for building the ADFS security token request.
:type fmt: string
t seconds( t datetimet utcnowt timedeltat DEFAULT_ADFS_TOKEN_EXPIRATIONt strftime( R t fmtt date_createdt date_expirest _[1]t _time( ( sJ /tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/extras/_saml2/v3/adfs.pyt _token_datesg s
c C sŲ h d d 6} h d d 6} h d d 6} h d d 6} t i d d
| i } t i | d } t i | d } | i d
d d | _ t i | d } d t i i | _ t i | d } t i | d }
d |
_ t i | d } | i d
d t i | d d
| } | i d
d t i | d }
|
i d d t i |
d } t i |
d } | i \ | _ | _ t i | d } | i d d t i i t i | d } t i | d d! d" } t i | d# } t i | d$ d
| } t i | d% d
| } t i | d&