mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[kbn-test] remove deprecated auth route (#179561)
## Summary Since ms-104 was released, we no longer need to support both deprecated and new cloud auth route. How to test: run any FTR test with SAML auth against MKI project
This commit is contained in:
parent
60a4989f18
commit
e832852938
1 changed files with 6 additions and 17 deletions
|
@ -73,8 +73,6 @@ const getCloudUrl = (hostname: string, pathname: string) => {
|
|||
|
||||
const createCloudSession = async (params: CreateSamlSessionParams) => {
|
||||
const { hostname, email, password, log } = params;
|
||||
// remove after ms-104 is released
|
||||
const deprecatedLoginUrl = getCloudUrl(hostname, '/api/v1/users/_login');
|
||||
const cloudLoginUrl = getCloudUrl(hostname, '/api/v1/saas/auth/_login');
|
||||
let sessionResponse: AxiosResponse | undefined;
|
||||
const requestConfig = (cloudUrl: string) => {
|
||||
|
@ -93,22 +91,13 @@ const createCloudSession = async (params: CreateSamlSessionParams) => {
|
|||
maxRedirects: 0,
|
||||
};
|
||||
};
|
||||
try {
|
||||
sessionResponse = await axios.request(requestConfig(deprecatedLoginUrl));
|
||||
} catch (ex) {
|
||||
log.error(`Failed to create the new cloud session with 'POST ${deprecatedLoginUrl}'`);
|
||||
// no error on purpose
|
||||
}
|
||||
|
||||
if (!sessionResponse || sessionResponse?.status === 404) {
|
||||
// Retrying with new cloud login endpoint
|
||||
try {
|
||||
sessionResponse = await axios.request(requestConfig(cloudLoginUrl));
|
||||
} catch (ex) {
|
||||
log.error(`Failed to create the new cloud session with 'POST ${cloudLoginUrl}'`);
|
||||
cleanException(cloudLoginUrl, ex);
|
||||
throw ex;
|
||||
}
|
||||
try {
|
||||
sessionResponse = await axios.request(requestConfig(cloudLoginUrl));
|
||||
} catch (ex) {
|
||||
log.error(`Failed to create the new cloud session with 'POST ${cloudLoginUrl}'`);
|
||||
cleanException(cloudLoginUrl, ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
const token = sessionResponse?.data?.token as string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue