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

Error: Unable resolve type IOpenIddictApplicationManager (dependency of OauthController) #871

Closed
rmunn opened this issue Jun 10, 2024 · 5 comments
Labels
DX Developer experience problem
Milestone

Comments

@rmunn
Copy link
Contributor

rmunn commented Jun 10, 2024

After rebasing my WIP branch on top of current develop to fix merge conflicts, I'm getting:

Unable to resolve service for type 'OpenIddict.Abstractions.IOpenIddictApplicationManager' while attempting to activate 'LexBoxApi.Controllers.OauthController'

@hahn-kev I believe this was introduced when #847 was merged.

@rmunn rmunn added the DX Developer experience problem label Jun 10, 2024
@hahn-kev
Copy link
Collaborator

It sounds like OAuth is disabled locally. Check the config? It's used in AuthKernel.

Also why is the OAuth Controller being activated? Are you trying to use OAuth?

@rmunn
Copy link
Contributor Author

rmunn commented Jun 10, 2024

I haven't touched the OAuthController code in my branch. AFAICT, it's being set up in AuthKernel.cs because I have

    "OpenId": {
      "Enable": true
    }

in my appsettings.Development.json file. A quick git blame suggests that that came from #809 (specifically, here).

I've tried setting "Enable": false, but so far that hasn't solved the issue. So maybe I'm wrong about why the OAuthController is being activated.

There's also an optional IOpenIddictApplicationManager dependency in SeedingData, but I don't see SeedingData in the C# logs so I don't think that's what's causing it. But I'm not really certain of any of my conclusions just now.

@hahn-kev
Copy link
Collaborator

It's possible that there's an environment variable that's overriding that when running in k8s. Did you check that?

hahn-kev added a commit that referenced this issue Jun 10, 2024
…d due to required service in the OauthController, it's now optional and the oauth controller will throw if it's not setup. #871
@hahn-kev
Copy link
Collaborator

Fixed.

@hahn-kev hahn-kev added this to the v2 (orgs) milestone Jun 10, 2024
@rmunn
Copy link
Contributor Author

rmunn commented Jun 11, 2024

Fix working for me, thanks.

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

No branches or pull requests

2 participants