MCPcopy Create free account
hub / github.com/apache/impala / ValidateSaml2AuthnResponse

Function ValidateSaml2AuthnResponse

be/src/rpc/authentication.cc:1022–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022TWrappedHttpResponse* ValidateSaml2AuthnResponse(
1023 ThriftServer::ConnectionContext* connection_context,
1024 const AuthenticationHash& hash) {
1025 TWrappedHttpRequest* request = connection_context->request.get();
1026 TWrappedHttpResponse* response = connection_context->response.get();
1027 DCHECK(request != nullptr);
1028 DCHECK(response == nullptr);
1029 response = new TWrappedHttpResponse();
1030 connection_context->response.reset(response);
1031 // Parse the body.
1032 std::map<string, string*> params_to_check;
1033 string saml_relay_state;
1034 params_to_check["RelayState"] = &saml_relay_state;
1035 string error_msg;
1036 const string& content = request->content;
1037 if(!ParseParams(params_to_check, content, content, &error_msg)) {
1038 LOG(ERROR) << "failed to parse SAML response params: " << error_msg;
1039 return nullptr;
1040 }
1041 StripWhiteSpace(&saml_relay_state);
1042 request->params["RelayState"] = saml_relay_state;
1043 // We return some html in case of auth error. TODO: Should handle other
1044 // errors where no response is generated.
1045 Status status =
1046 ExecEnv::GetInstance()->frontend()->ValidateSaml2Response(*request, response);
1047 return response;
1048}
1049
1050bool ValidateSaml2Bearer(ThriftServer::ConnectionContext* connection_context,
1051 const AuthenticationHash& hash) {

Callers

nothing calls this directly

Calls 6

ParseParamsFunction · 0.85
ValidateSaml2ResponseMethod · 0.80
getMethod · 0.65
resetMethod · 0.65
StripWhiteSpaceFunction · 0.50
frontendMethod · 0.45

Tested by

no test coverage detected