Skip to content

OpenID Authentication gives error when fhir-server run in container #5188

@rgknp

Description

@rgknp

fhir-server has built in identity provider for development (F5 experience). It works fine when running the code in debug mode in an IDE (e.g. Visual Studio). However if you build a local docker image run it as container locally, authentication doesn't work and it throws various errors. For example it throws invalid client id. Some times it throws JWT token could not be validated.

environment:
  - DataStore=SqlServer
  - SqlServer__Initialize=true
  - SqlServer__AllowDatabaseCreation=true
  - SqlServer__SchemaOptions__AutomaticUpdatesEnabled=true
  - FhirServer__Security__Enabled=true
  - FhirServer__Security__Authentication__Authority=https://fhir:8443/
  - FhirServer__Security__Authentication__Audience=fhir-api
  - DevelopmentIdentityProvider__Enabled=true
  - TestAuthEnvironment__FilePath=/app/config/testauthenvironment.json
  - ASPNETCORE_URLS=http://+:8080;https://+:8443

FHIR Version?
R4

Data provider?
SQL Server

To Reproduce
Steps to reproduce the behavior:

  1. Copy repo to local IDE
  2. build docker image, enable security
  3. deploy image in a container
  4. get access token
  5. send CURL request to post a FHIR resource

Expected behavior
Request should be successful

Actual behavior
Throws error invalid token it could not be validated.

Issue is that JWT bearer token auth and OpenID are getting activated at the same time even if - DevelopmentIdentityProvider__Enabled=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug bug bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions