Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Discuss
  3. Cloudron OIDC with SPA Frontend - PKCE Configuration Missing?

Cloudron OIDC with SPA Frontend - PKCE Configuration Missing?

Scheduled Pinned Locked Moved Discuss
3 Posts 3 Posters 442 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jorrg
    wrote on last edited by
    #1

    Hi everyone,

    I'm trying to set up authentication for a simple web application and I'm running into some confusion around OAuth/OIDC best practices with Cloudron.

    My Setup:

    • Frontend: Static website served by Surfer (Cloudron app)
    • Backend: n8n workflows for API endpoints
    • Authentication: Want to use Cloudron's built-in OIDC

    My Intended Flow:

    • User clicks login on frontend (JavaScript SPA)
    • Redirect to Cloudron OIDC authorization endpoint
    • User authenticates with Cloudron
    • Frontend receives authorization code/token
    • Frontend passes token to n8n backend for verification
    • n8n validates token with Cloudron and proceeds with authorized operations

    The Problem:
    I understand that exposing a client_secret in JavaScript is a security anti-pattern. For single-page applications, the recommended approach is to use a "public client" with PKCE (Proof Key for Code Exchange) instead of client secrets.

    However, when I look at Cloudron's OIDC app configuration, I don't see any option to:

    • Configure a client as "public" (no secret required)
    • Enable PKCE support
    • Set the client type appropriately for SPAs

    My Questions:

    • Does Cloudron's OIDC implementation support public clients with PKCE?
    • If not, what's the recommended pattern for SPA authentication with Cloudron?
    • Should I be using a different flow entirely (like having n8n handle the OAuth dance server-side)?
    • Is installing a separate Keycloak instance the only way to get proper SPA OIDC support?

    I'm hoping there's a standard way to handle this that I'm missing. The alternative of putting authentication logic entirely in n8n (server-side) seems to complicate the frontend significantly.

    Any guidance on the proper architecture pattern here would be greatly appreciated!

    Additional Context:

    • All components are running on the same Cloudron instance
    • I'd prefer to stick with Cloudron's built-in capabilities if possible

    Thanks in advance!

    1 Reply Last reply
    1
    • jamesJ james marked this topic as a regular topic on
    • jamesJ james moved this topic from Support on
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote on last edited by
      #2

      Hello @jorrg
      I've moved your topic to the @discuss section since this is no direct issue of the Cloudron platform itself.

      This is a very interesting setup you are running there.
      Your questions regarding PKCE are valid, and we will have to look into it.

      1 Reply Last reply
      2
      • nebulonN Away
        nebulonN Away
        nebulon
        Staff
        wrote on last edited by
        #3

        We use https://github.com/panva/node-oidc-provider internally and that is supposed to support PKCE. Not sure yet how to use it to test what this needs.

        Until that is working, the options are a keycloak instance or a small backend which gives the SPA some kind of session while handling the oidc login bits.

        1 Reply Last reply
        3

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search