public async Task <RootResponse> Post(RootRequest request) { string validationResponse = "UNVERIFIED"; using (var context = new PrincipalContext(ContextType.Domain, _settings.LdapDomain, _settings.ADServiceAccount, _settings.ADServiceAccountPwd)) { if (request == null || request.data == null || request.data.context == null || request.data.context.credential == null || request.data.context.credential.username == null || request.data.context.credential.password == null) { return(new RootResponse()); } _logger.LogInformation("Verifying password for:" + request.data.context.credential.username); if (context.ValidateCredentials(request.data.context.credential.username, request.data.context.credential.password)) { _logger.LogInformation("Verified password successfully for:" + request.data.context.credential.username); validationResponse = "VERIFIED"; } } Command command = new Command() { type = "com.okta.action.update", value = new Value() { credential = validationResponse } }; RootResponse response = new RootResponse(); response.commands = new List <Command>(); response.commands.Add(command); return(response); }
public TestResponse Get(RootRequest request) { return(new TestResponse { Message = "Hello from root" }); }
public static Task <Root> GetRootAsync(this IHalClient client, RootRequest request) { return(client.GetRootAsync <Root>(request)); }
public GetProfile() { RootRequest.LoadWeb(); }
public SearchDestinyPlayer() { RootRequest.LoadWeb(); }