question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Basket.API project failed to use ByPassAuthMiddleware

See original GitHub issue

If the authentication center identity.API is not enabled, when using the manual default user test, the Claim is reported as an error. 图片

Because when we add a test user in the middleware(file : /src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs), the claim Type of the user Name is ‘name’:

new Claim("name", "Test user"),
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"),

But in BasketController CheckoutAsync method, using ClaimType is (http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name),

var userName = this.HttpContext.User.FindFirst(x => x.Type == ClaimTypes.Name).Value;

the two do not match.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
anjoy8commented, Nov 22, 2020

Hello @sughosneo @anjoy8,

I am a newbie in this repo, I’d like to contribute to this project, is there a bug list from easy to hard for me to get familiar with project?

Thanks, Thanh

@thanhauco Currently there is no list, but you can modify the bug from the Issue list

1reaction
anjoy8commented, Oct 30, 2020

The steps are as follows:

1. Download the source code for the Dev branch

图片

2. The basket.API project starts by default

图片

3. Configure EventBus and Redis ConnectionString and set UseLoadTest to true

{
  "Serilog": {
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft": "Warning",
        "Microsoft.eShopOnContainers": "Debug",
        "System": "Warning"
      }
    }
  },
  "IdentityUrlExternal": "http://localhost:5105",
  "IdentityUrl": "http://localhost:5105",
  "ConnectionString": "xxx.25.251.xx,password=xxxx!",
  "AzureServiceBusEnabled": false,
  "EventBusConnection": "xxx.25.251.xx",
  "EventBusUserName": "xxx",
  "EventBusPassword": "xxxx!",
  "UseLoadTest": true

}

4. Start Kestrel mode

图片

5. Configure test user’s userid = ‘123456798’

https://localhost:5103/noauth?userid=123456798 图片

6. Add a shopping cart

图片

7, Checkout user ‘123456798’ shopping cart

{
  "city": "string",
  "street": "string",
  "state": "string",
  "country": "string",
  "zipCode": "string",
  "cardNumber": "string",
  "cardHolderName": "string",
  "cardExpiration": "2020-10-30T02:47:02.882Z",
  "cardSecurityNumber": "string",
  "cardTypeId": 1,
  "buyer": "123456798",
  "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

8. An exception error occurred

图片

图片

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix this error "warn: Microsoft.AspNetCore. ...
Good evening , I am trying to build a simple web api using ASP.Net . The app has been showing the error like...
Read more >
"Build failed" on Database First Scaffold-DbContext
Two most important tips: [1] - Make sure that your project builds completely before you run a new scaffold command. Otherwise.
Read more >
Errors | HTTP API | commercetools Composable Commerce
Common HTTP error codes returned by the commercetools Composable Commerce APIs and their meaning. Error responses have the same overall structure across the ......
Read more >
Standard Error Messages | Search Console API
The request failed because a per-user rate limit has been reached, and the client developer was not identified in the request. Please use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found