openfaas / openfaas/faas-cli

Feature: Support OAuth2/OIDC and Bearer token

Open
#647 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design/review help wanted priority/high size/l skill/intermediate
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

Feature: Support OAuth2/OIDC and Bearer token

Expected Behaviour

As a user with a custom OAuth2/OIDC OpenFaaS authentication plugin configured on my gateway, I need to be able to "log in" and invoke the various CLI commands.

Current Behaviour

We can accommodate this in the OpenFaaS portal UI with no additional changes through the use of cookies issued in the OpenFaaS authentication plugin.

The OpenFaaS CLI does not support this workflow

Possible Solution

  • Update faas-cli login to obtain an id_token via implicit flow/grant-type
  • Update faas-cli login to store an id_token optionally instead of basic-auth credentials - add a new flag perhaps?
  • Update the various commands which currently add basic-auth credentials to set a header of Authorization: Bearer {ID_TOKEN}

Test e2e with a test harness like faas-memory or a hacked end-point.

Steps to Reproduce (for bugs)

  1. Configure OAuth2 for the gateway auth module
  2. Run faas-cli login and see data stored in ~/.openfaas/config.yml
  3. Run faas-cli up successfully

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the faas-cli login flow, credential storage in ~/.openfaas/config.yml, and the commands that currently use basic authentication. Review the proposed OAuth2/OIDC flow and test against faas-memory or a hacked endpoint. Done means login can store an id_token and CLI commands can authenticate with a Bearer token, with end-to-end coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.