OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.41k stars 2.39k forks source link

External OIDC server, custom OC module can't authenticate to APIs #6047

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi, I'm having some issues understanding what's missing/wrong in my current setup I've successfully configured OC to use IdentityServer4/OpenIdConnect (OC is a client, not acting as server): registration only for external users, roles mapped through the script, all seems to work as expected.

I've added a custom MVC module and I can enable it and use it with no issues. This custom module should get data from some APIs in another application and the authentication should be done with OIDC but so far I had no luck. In the custom module I've enabled authorization and it seems to work but it's not clear how to use the bearer token coming from OC to authenticate the user in the external API

I'm using the packages v. 1.0.0-rc1-12916 A good starting point would be knowing how to see the OIDC tokens from within the custom module. Thanks

sebastienros commented 4 years ago

We need a guide.