Fix for bug #
parent
20e728afac
commit
913a75f410
|
@ -40,6 +40,7 @@
|
|||
* cas-ticket:< > value =
|
||||
* cas-pgtiou:< > value =
|
||||
* session:< > value =
|
||||
* saml2-login:< > value =
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* SOGoSAML2Session.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2012 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Copyright (C) 2012-2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* SOGoSAML2Session.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2012 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Copyright (C) 2012-2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -215,7 +213,6 @@ LassoServerInContext (WOContext *context)
|
|||
|
||||
- (void) _updateDataFromLogin
|
||||
{
|
||||
// LassoSamlp2Response *response;
|
||||
LassoSaml2Assertion *saml2Assertion;
|
||||
GList *statementList, *attributeList;
|
||||
LassoSaml2AttributeStatement *statement;
|
||||
|
@ -223,10 +220,15 @@ LassoServerInContext (WOContext *context)
|
|||
LassoSaml2AttributeValue *value;
|
||||
LassoMiscTextNode *textNode;
|
||||
LassoSaml2NameID *nameIdentifier;
|
||||
SOGoSystemDefaults *sd;
|
||||
NSString *loginAttribue;
|
||||
|
||||
gchar *dump;
|
||||
|
||||
saml2Assertion
|
||||
= LASSO_SAML2_ASSERTION (lasso_login_get_assertion (lassoLogin));
|
||||
saml2Assertion = LASSO_SAML2_ASSERTION (lasso_login_get_assertion (lassoLogin));
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
loginAttribue = [sd SAML2LoginAttribute];
|
||||
|
||||
if (saml2Assertion)
|
||||
{
|
||||
/* deduce user login */
|
||||
|
@ -241,6 +243,25 @@ LassoServerInContext (WOContext *context)
|
|||
while (!login && attributeList)
|
||||
{
|
||||
attribute = LASSO_SAML2_ATTRIBUTE (attributeList->data);
|
||||
if (loginAttribue && (strcmp (attribute->Name, [loginAttribue UTF8String]) == 0))
|
||||
{
|
||||
value = LASSO_SAML2_ATTRIBUTE_VALUE (attribute->AttributeValue->data);
|
||||
textNode = value->any->data;
|
||||
|
||||
// If we got an @ sign in the value, it's most likely an email address
|
||||
// so we'll ask SOGoUserManager about this
|
||||
login = [NSString stringWithUTF8String: textNode->content];
|
||||
|
||||
if ([login rangeOfString: @"@"].location != NSNotFound)
|
||||
{
|
||||
login = [[SOGoUserManager sharedUserManager] getUIDForEmail: login];
|
||||
}
|
||||
|
||||
[login retain];
|
||||
}
|
||||
else if (!loginAttribue)
|
||||
{
|
||||
// We fallback on "standard" attributes such as "uid" and "mail"
|
||||
if (strcmp (attribute->Name, "uid") == 0)
|
||||
{
|
||||
value = LASSO_SAML2_ATTRIBUTE_VALUE (attribute->AttributeValue->data);
|
||||
|
@ -255,7 +276,8 @@ LassoServerInContext (WOContext *context)
|
|||
login = [[SOGoUserManager sharedUserManager] getUIDForEmail: [NSString stringWithUTF8String: textNode->content]];
|
||||
[login retain];
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
attributeList = attributeList->next;
|
||||
}
|
||||
statementList = statementList->next;
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
/* SOGoSession.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2011 Inverse inc.
|
||||
*
|
||||
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
* Francis Lachapelle <flachapelle@inverse.ca>
|
||||
* Copyright (C) 2010-2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
/* SOGoSession.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2011 Inverse inc.
|
||||
*
|
||||
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
* Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* Copyright (C) 2010-2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
- (NSString *) SAML2IdpMetadataLocation;
|
||||
- (NSString *) SAML2IdpPublicKeyLocation;
|
||||
- (NSString *) SAML2IdpCertificateLocation;
|
||||
- (NSString *) SAML2LoginAttribute;
|
||||
- (BOOL) SAML2LogoutEnabled;
|
||||
|
||||
- (BOOL) enablePublicAccess;
|
||||
|
|
|
@ -511,6 +511,11 @@ _injectConfigurationFromFile (NSMutableDictionary *defaultsDict,
|
|||
return [self boolForKey: @"SOGoSAML2LogoutEnabled"];
|
||||
}
|
||||
|
||||
- (NSString *) SAML2LoginAttribute
|
||||
{
|
||||
return [self stringForKey: @"SOGoSAML2LoginAttribute"];
|
||||
}
|
||||
|
||||
- (BOOL) enablePublicAccess
|
||||
{
|
||||
return [self boolForKey: @"SOGoEnablePublicAccess"];
|
||||
|
|
Loading…
Reference in New Issue