Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingnore Tenant in case of invalid scope on JWT microservice #21188

Open
1 task done
andmattia opened this issue Oct 25, 2024 · 2 comments
Open
1 task done

Ingnore Tenant in case of invalid scope on JWT microservice #21188

andmattia opened this issue Oct 25, 2024 · 2 comments

Comments

@andmattia
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Description

I found that my microservice ignore tenant even if my user is tenant user.

Reproduction Steps

Step to reproduce:

  • create microservice name MyFirstMiscroService
  • add manual scope MyFirstMiscroService2
  • configure all to give access to MyFirstMiscroService2
  • got to API page do login in tenant
  • check JWT that user is tenant user
  • create an enetity

Now you can see that entity has tanantId null

Expected behavior

I hexpected to have a 401 / 403 error

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

7.4.5

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@andmattia andmattia added the bug label Oct 25, 2024
@maliming
Copy link
Member

hi

We are unable to reproduce the problem based on your steps.

image

@maliming maliming removed the bug label Oct 28, 2024
@andmattia
Copy link
Contributor Author

andmattia commented Oct 29, 2024

So strange in my case it's quite simple. Are sure to use different name in

 JwtBearerConfigurationHelper.Configure(context, "QualityService");
        SwaggerConfigurationHelper.ConfigureWithOidc(
            context: context,
            authority: configuration["AuthServer:Authority"]!,
            scopes: new[] { "QualityService" },
            flows: new[] { "authorization_code" },
            discoveryEndpoint: configuration["AuthServer:MetadataAddress"],
            apiTitle: "QualityService Service API"
        );
...

in OpenId Scope change QualityService -> BadQualityService from *HttpApiHostModule.Cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants