Ejemplo n.º 1
0
def finish_artifact_resolve(request, login, provider_id, session_key=None):
    '''Finish artifact resolver processing:
        compute a response, returns it and eventually update stored
        LassoSession.

        provider_id: the entity id of the provider which should receive the artifact
        session_key: the session_key of the session linked to the artifact, if None it means no artifact was found
    '''
    try:
        login.buildResponseMsg(provider_id)
    except:
        raise
    if session_key:
        save_session(request, login, session_key=session_key)
    return return_saml_soap_response(login)
Ejemplo n.º 2
0
def finish_artifact_resolve(request, login, provider_id, session_key = None):
    '''Finish artifact resolver processing:
        compute a response, returns it and eventually update stored
        LassoSession.

        provider_id: the entity id of the provider which should receive the artifact
        session_key: the session_key of the session linked to the artifact, if None it means no artifact was found
    '''
    try:
        login.buildResponseMsg(provider_id)
    except:
        raise
    if session_key:
        save_session(request, login,
                session_key = session_key)
    return return_saml_soap_response(login)
Ejemplo n.º 3
0
def finish_sso(request, login, user = None, save = True):
    '''Return the response to an AuthnRequest

       user: the user which must be federated, if None default to current user.
       save: whether to save the result of this transaction or not.
    '''
    if user is None:
        user = request.user
    if login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_ART:
        login.buildArtifactMsg(lasso.HTTP_METHOD_REDIRECT)
        save_artifact(request, login)
    elif login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_POST:
        login.buildAuthnResponseMsg()
    else:
        raise NotImplementedError()
    if save:
        save_federation(request, login)
        save_session(request, login)
    return return_idff12_response(request, login,
            title=_('Authentication response'))
Ejemplo n.º 4
0
def finish_sso(request, login, user=None, save=True):
    '''Return the response to an AuthnRequest

       user: the user which must be federated, if None default to current user.
       save: whether to save the result of this transaction or not.
    '''
    if user is None:
        user = request.user
    if login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_ART:
        login.buildArtifactMsg(lasso.HTTP_METHOD_REDIRECT)
        save_artifact(request, login)
    elif login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_POST:
        login.buildAuthnResponseMsg()
    else:
        raise NotImplementedError()
    if save:
        save_federation(request, login)
        save_session(request, login)
    return return_idff12_response(request,
                                  login,
                                  title=_('Authentication response'))