vue -msal не может разрешить конечные точки. Пожалуйста, проверьте сеть и попробуйте снова. Подробности: функция toString () {[собственный код]} - PullRequest
0 голосов
/ 29 апреля 2020

ClientAuthError: Ошибка: не удалось разрешить конечные точки. Пожалуйста, проверьте сеть и попробуйте снова. Подробности: функция toString () {[собственный код]} в ClientAuthError.AuthError [как конструктор] (webpack-internal: ///./node_modules/msal/lib-es6/error/AuthError.js: 26: 28) в новом ClientAuthError (webpack-internal: ///./node_modules/msal/lib-es6/error/ClientAuthError.js: 111: 28) в Function.ClientAuthError.createEndpointResolutionError (webpack-internal: ///./node_modules /msal/lib-es6/error/ClientAuthError.js:121:16) в eval (webpack-internal: ///./node_modules/msal/lib-es6/UserAgentApplication.js: 465: 125) VM11105 : 1 GET

ClientAuthError: Error: could not resolve endpoints. Please check network and try again. Details: function toString() { [native code] }
    at ClientAuthError.AuthError [as constructor] (webpack-internal:///./node_modules/msal/lib-es6/error/AuthError.js:26:28)
    at new ClientAuthError (webpack-internal:///./node_modules/msal/lib-es6/error/ClientAuthError.js:111:28)
    at Function.ClientAuthError.createEndpointResolutionError (webpack-internal:///./node_modules/msal/lib-es6/error/ClientAuthError.js:121:16)
    at eval (webpack-internal:///./node_modules/msal/lib-es6/UserAgentApplication.js:465:125)
VM11105:1 GET https://caatdevportal.onmicrosoft.com/caatdevportal.onmicrosoft.com/b2c_1a_signuporsignin/v2.0/.well-known/openid-configuration net::ERR_NAME_NOT_RESOLVED

конфиг здесь, и не знаю, почему

Vue.use(MSAL, {
  auth: {
    clientId: "**************************",
    redirectUri: "https://localhost:44390",
    tenantId: "devportal.onmicrosoft.com/B2C_1_employee_test_sign",
    tenantName: "devportal.onmicrosoft.com",
    requireAuthOnInitialize: true,
    validateAuthority: false,
    onAuthentication: (ctx, error, response) => {
      console.log(response);
      console.log(ctx);
      console.log(error);
    },
    onToken: (ctx, error, response) => {
      console.log(response);
      console.log(ctx);
      console.log(error);
    },
  },
  graph: {
    callAfterInit: true,
    endpoints: {
      profile: "/me",
      photo: { url: "/me/photo/$value", responseType: "blob", force: true },
    },
  },
  request: {
    scopes: null,
  },
});

1 Ответ

0 голосов
/ 10 мая 2020

Я использовал angular, но я получил ту же ошибку. По сути, конечная точка входа в систему, на которую вы нацеливаетесь, недопустима и должна иметь следующий формат:

https://<tenant_name>.b2clogin.com/<tenant_name>.onmicrosoft.com/<policy_name>

Обратите внимание, что для вашего tenantName следует указывать b2login.com, а не onmicrosoft.com :)

Так что в вашем случае я бы попробовал:

Vue.use(MSAL, {
  auth: {
    clientId: "**************************",
    redirectUri: "https://localhost:44390",
    tenantId: "devportal.onmicrosoft.com/B2C_1_employee_test_sign",
    tenantName: "devportal.b2clogin.com",
    requireAuthOnInitialize: true,
    validateAuthority: false,
    onAuthentication: (ctx, error, response) => {
      console.log(response);
      console.log(ctx);
      console.log(error);
    },
    onToken: (ctx, error, response) => {
      console.log(response);
      console.log(ctx);
      console.log(error);
    },
  },
  graph: {
    callAfterInit: true,
    endpoints: {
      profile: "/me",
      photo: { url: "/me/photo/$value", responseType: "blob", force: true },
    },
  },
  request: {
    scopes: null,
  },
});
...