roflbobl

roflbobl

How to disable https for oidcc/ueberauth

Currently im trying to implement ueberauth_oidcc where i am using a local keycloak server as identity provider.

Since i’m developing locally i use http, but I get this error when starting my app:

Error Details: {:configuration_load_failed, {:invalid_config_property, {:uri_https, :userinfo_endpoint}}}

The error is quite clear, I need to use https. But I can’t for the life of me figure out how to disable this check locally when im developing. I followed this tutorial: UeberauthOidcc — Ueberauth OIDCC v0.4.2

Hope someone can help me.

This is my dev.exs

config :ueberauth_oidcc, :issuers, [
  %{
    name: :oidcc_issuer,
    issuer: "http://localhost:8080/realms/my-realm"
  }
]

config :ueberauth, Ueberauth,
  providers: [
    oidc: {
      Ueberauth.Strategy.Oidcc,
      # Additional HTTP tolerance
      issuer: :oidcc_issuer,
      client_id: "my-realm-phoenix",
      client_secret: "my-secret",
      scopes: ["openid", "profile", "email"],
      callback_path: "/auth/callback",
      userinfo: false,
      validate_scopes: false,
      uid_field: "email",
    }
  ]

Marked As Solved

LostKobrakai

LostKobrakai

config :ueberauth_oidcc, :issuers, [
  %{
    name: :oidcc_issuer,
    issuer: "http://localhost:8080/realms/my-realm",
    provider_configuration_opts: %{
      quirks: %{allow_unsafe_http: true}
    }
  }
]

This should work based on the typespecs on Oidcc.ProviderConfiguration.Worker — Oidcc v3.7.2, which is what the library uses: lib/ueberauth_oidcc/application.ex · main · Paul Swartz / ueberauth_oidcc · GitLab

Also Liked

LostKobrakai

LostKobrakai

oidcc has an option for providers: oidcc_provider_configuration — Oidcc v3.7.2

Not sure how you’d pass that when using the ueberauth strategy though.

Last Post!

roflbobl

roflbobl

Thank you so much!

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement