microsoft / msstore-cli

Microsoft Store CLI
MIT License
72 stars 7 forks source link

Auth failed message when trying to configure msstore #25

Closed eskuat closed 4 months ago

eskuat commented 7 months ago

Trying to configure msstore for work and constantly getting "Failed to auth... Might just need to wait a little bit." errors So I double checked all the ID's and my secret - they are correct. Please advice what can be wrong ?

msstore version 0.1.27.12+1f6c1f0e4a OS Windows 11 pro

Command line and verbose output

(venv) PS C:\Development> msstore reconfigure -t <TENANT ID> -s <SELLER ID> -c <CLIENT ID> -cs <SECRET> -vvv
10:01:23 info: MSStore.API.StoreAPI[0] Getting authorization token
10:01:27 fail: MSStore.API.StoreAPI[0] => GetClientCredentialAccessToken Failed to get access token. Response: Service is unavailable to process the request

10:01:27 info: MSStore.CLI.Services.CLIConfigurator[0] Error while creating StoreAPI. MSStore.API.MSStoreException: Could not retrieve access token  ---> MSAL.NetCore.4.58.0.0.MsalServiceException:
        ErrorCode: service_not_available
Microsoft.Identity.Client.MsalServiceException: Service is unavailable to process the request    at Microsoft.Identity.Client.Http.HttpManagerWithRetry.SendRequestAsync(Uri endpoint, IDictionary`2
headers, HttpContent body, HttpMethod method, ILoggerAdapter logger, Boolean doNotThrow, Boolean retry, CancellationToken cancellationToken)    at
Microsoft.Identity.Client.Http.HttpManagerWithRetry.SendRequestAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ILoggerAdapter logger, Boolean doNotThrow, Boolean retry,
CancellationToken cancellationToken)    at Microsoft.Identity.Client.Http.HttpManagerWithRetry.SendPostAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, ILoggerAdapter logger, CancellationToken
cancellationToken)    at Microsoft.Identity.Client.Http.HttpManager.SendPostAsync(Uri endpoint, IDictionary`2 headers, IDictionary`2 bodyParameters, ILoggerAdapter logger, CancellationToken
cancellationToken)    at Microsoft.Identity.Client.OAuth2.OAuth2Client.ExecuteRequestAsync[T](Uri endPoint, HttpMethod method, RequestContext requestContext, Boolean expectErrorsOn200OK, Boolean
addCommonHeaders, Func`2 onBeforePostRequestData)    at Microsoft.Identity.Client.OAuth2.OAuth2Client.GetTokenAsync(Uri endPoint, RequestContext requestContext, Boolean addCommonHeaders, Func`2
onBeforePostRequestHandler)    at Microsoft.Identity.Client.OAuth2.TokenClient.SendHttpAndClearTelemetryAsync(String tokenEndpoint, ILoggerAdapter logger)    at
Microsoft.Identity.Client.OAuth2.TokenClient.SendHttpAndClearTelemetryAsync(String tokenEndpoint, ILoggerAdapter logger)    at
Microsoft.Identity.Client.OAuth2.TokenClient.SendTokenRequestAsync(IDictionary`2 additionalBodyParameters, String scopeOverride, String tokenEndpointOverride, CancellationToken cancellationToken)    at
Microsoft.Identity.Client.Internal.Requests.RequestBase.SendTokenRequestAsync(IDictionary`2 additionalBodyParameters, CancellationToken cancellationToken)    at
Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest.GetAccessTokenAsync(CancellationToken cancellationToken, ILoggerAdapter logger)    at
Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest.ExecuteAsync(CancellationToken cancellationToken)    at
Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)    at
Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenForClientParameters clientParameters, CancellationToken
cancellationToken)    at MSStore.API.SubmissionClient.GetClientCredentialAccessTokenAsync(String tenantId, String clientId, String clientSecret, String scope, ILogger logger, CancellationToken ct) in
/_/MSStore.API/SubmissionClient.cs:line 144
        StatusCode: 500
        ResponseBody: {
        "error":"server_error",
        "error_description":"AADSTS50000: There was an error issuing a token or an issue with our sign-in service. Trace ID: 1f3f2ee3-a461-4fbc-b28a-875e6e995e00 Correlation
ID: 372f2292-1ecb-490e-bf3b-a6f973c6afaa Timestamp: 2023-12-06 09:01:27Z",
        "error_codes":[50000],
        "timestamp":"2023-12-06 09:01:27Z",
        "trace_id":"1f3f2ee3-a461-4fbc-b28a-875e6e995e00",
        "correlation_id":"372f2292-1ecb-490e-bf3b-a6f973c6afaa",
        "error_uri":"https://login.microsoftonline.com/error?code=50000"}

        Headers: Cache-Control: no-store, no-cache Pragma: no-cache Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
client-request-id: 372f2292-1ecb-490e-bf3b-a6f973c6afaa x-ms-request-id: 1f3f2ee3-a461-4fbc-b28a-875e6e995e00 x-ms-ests-server: 2.1.16878.5 - EUS ProdSlices x-ms-clitelem: 1,50000,0,, X-XSS-Protection: 0
Set-Cookie: fpc=At4k8yXqWVJEhqPbBeXFUmGMRaWHAgAAAGQvAt0OAAAA; expires=Fri, 05-Jan-2024 09:01:27 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd; path=/; secure; httponly Date: Wed,
06 Dec 2023 09:01:26 GMT
--- End of inner exception stack trace ---

at MSStore.API.SubmissionClient.GetClientCredentialAccessTokenAsync(String tenantId, String clientId, String clientSecret, String
scope, ILogger logger, CancellationToken ct) in /_/MSStore.API/SubmissionClient.cs:line 151    at MSStore.API.StoreAPI.InitAsync(HttpClient httpClient, CancellationToken ct) in
/_/MSStore.API/StoreAPI.cs:line 101    at MSStore.CLI.Services.StoreAPIFactory.CreateAsync(Configurations config, CancellationToken ct) in /_/MSStore.CLI/Services/StoreAPIFactory.cs:line 49    at
MSStore.CLI.Services.CLIConfigurator.<>c__DisplayClass10_0.<<ConfigureAsync>b__2>d.MoveNext() in /_/MSStore.CLI/Services/CLIConfigurator.cs:line 312
azchohfi commented 4 months ago

It seems like the service was down. Can you try again?

azchohfi commented 4 months ago

I'm going to close this. Let us know if that was not the case.

Juliotati commented 3 months ago

@azchohfi I've just come across this same issue. Unfortunately there's no additional information and not sure if it's related to the service being down.

Any idea what it might be?

Screenshot 2024-03-30 at 07 22 05
Juliotati commented 3 months ago

Fixed! I didn't have the app created in https://portal.azure.com/ 🤔

Screenshot 2024-03-30 at 09 16 31