public User(Credentials credentials, AuthenticationToken token, string name, Rights rights) : this(credentials, token, UserStatus.User, name, null, rights) { }
public User(Credentials credentials, AuthenticationToken token, UserStatus status, string name, string descr, Rights rights) { m_Credentials = credentials; m_AuthenticationToken = token; m_Status = status; m_Name = name; m_Description = descr; m_Rights = rights; }
public User Authenticate(Credentials credentials) { return User.Fake; }
private static string getBaseAuthString(Credentials credentials) { var payPalCredentials = credentials as PayPalCredentials; var bytes = Encoding.UTF8.GetBytes(BASIC_AUTH_FORMAT.Args(payPalCredentials.ClientID, payPalCredentials.ClientSecret)); return Convert.ToBase64String(bytes); }
public User Authenticate(Credentials credentials) { var sect = m_Config ?? App.ConfigRoot[CommonApplicationLogic.CONFIG_SECURITY_SECTION]; if (sect.Exists && credentials is IDPasswordCredentials) { var idpass = (IDPasswordCredentials)credentials; var usern = findUserNode(sect, idpass); if (usern.Exists) { var name = usern.AttrByName(CONFIG_NAME_ATTR).ValueAsString(string.Empty); var descr = usern.AttrByName(CONFIG_DESCRIPTION_ATTR).ValueAsString(string.Empty); var status = usern.AttrByName(CONFIG_STATUS_ATTR).ValueAsEnum<UserStatus>(UserStatus.Invalid); var rights = Rights.None; var rightsn = usern[CONFIG_RIGHTS_SECTION]; if (rightsn.Exists) { var data = new MemoryConfiguration(); data.CreateFromNode(rightsn); rights = new Rights(data); } return new User(credentials, credToAuthToken(idpass), status, name, descr, rights); } } return new User(credentials, new AuthenticationToken(), UserStatus.Invalid, StringConsts.SECURITY_NON_AUTHENTICATED, StringConsts.SECURITY_NON_AUTHENTICATED, Rights.None); }
private string getAuthHeader(Credentials credentials) { if (credentials is BraintreeCredentials) return HDR_AUTHORIZATION_BASIC.Args(getBasicAuthString((credentials as BraintreeCredentials))); if (credentials is BraintreeAuthCredentials) return HDR_AUTHORIZATION_OAUTH.Args((credentials as BraintreeAuthCredentials).AccessToken); throw new NFXException("{0}.getAuthHeader({1})".Args(GetType().Name, credentials.GetType().Name)); }
/// <summary> /// Inits header with Credentials instance. /// Note: passing IDPasswordCredentials over public wire is not a good practice, /// pass AuthenticationToken instead /// </summary> public AuthenticationHeader(Credentials credentials) { m_Credentials = credentials; }
public User Authenticate(Credentials credentials) { return(User.Fake); }