/// <summary> /// Finds all Authentication Code data with created Date1, created Date2 containing specified keyword /// </summary> /// <param name="createdDate1"> Created Date</param> /// <param name="createdDate2"> Created Date</param> /// <returns>The result of the operation</returns> public OperationResult FindByCreatedDateBetween(DateTime createdDate1, DateTime createdDate2) { IFindAuthenticationCodeRepository repository = (IFindAuthenticationCodeRepository)RepositoryFactory.Create(Keywords.FindAuthenticationCode); try { List <AuthenticationCode> res = repository.FindByCreatedDateBetween(createdDate1, createdDate2); return(new OperationResult(true, res)); } catch (Exception e) { return(new OperationResult(false, e)); } }
/// <summary> /// Finds all Authentication Code data with authorization Session I D containing specified keyword /// </summary> /// <param name="authorizationSessionID"> Authorization Session I D</param> /// <returns>The result of the operation</returns> public OperationResult FindByAuthorizationSessionID(string authorizationSessionID) { IFindAuthenticationCodeRepository repository = (IFindAuthenticationCodeRepository)RepositoryFactory.Create(Keywords.FindAuthenticationCode); try { List <AuthenticationCode> res = repository.FindByAuthorizationSessionID(authorizationSessionID); return(new OperationResult(true, res)); } catch (Exception e) { return(new OperationResult(false, e)); } }
public OperationResult CheckAuthorizationCode(string clientID, string clientSecret, string authorizationCode) { IFindAuthenticationCodeRepository bs = (IFindAuthenticationCodeRepository)RepositoryFactory.Create("Find.Tools.OAuthServerManager.AuthenticationCode"); List <AuthenticationCode> codes = bs.FindByAuthenticationCodeString(authorizationCode); if (codes.Count > 0) { AuthenticationCode code = codes[0]; if (code.ClientID == clientID) { return(new OperationResult(true)); } else { return(new OperationResult(false)); } } else { return(new OperationResult(false)); } }