Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erlef/phx_gen_oidcc
An OpenID Login Generator for Phoenix 1.7 Projects
https://github.com/erlef/phx_gen_oidcc
elixir generator openid openid-connect phoenix phoenix-framework security-wg
Last synced: 2 months ago
JSON representation
An OpenID Login Generator for Phoenix 1.7 Projects
- Host: GitHub
- URL: https://github.com/erlef/phx_gen_oidcc
- Owner: erlef
- License: apache-2.0
- Created: 2023-09-14T21:21:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-10T21:40:35.000Z (3 months ago)
- Last Synced: 2024-11-10T22:30:35.701Z (3 months ago)
- Topics: elixir, generator, openid, openid-connect, phoenix, phoenix-framework, security-wg
- Language: Elixir
- Homepage: https://hexdocs.pm/phx_gen_oidcc
- Size: 60.5 KB
- Stars: 8
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Phx Gen Oidcc
An OpenID Login Generator for Phoenix 1.7 Projects
[![EEF Security WG project](https://img.shields.io/badge/EEF-Security-black)](https://github.com/erlef/security-wg)
[![Main Branch](https://github.com/erlef/phx_gen_oidcc/actions/workflows/branch_main.yml/badge.svg?branch=main)](https://github.com/erlef/phx_gen_oidcc/actions/workflows/branch_main.yml)
[![Module Version](https://img.shields.io/hexpm/v/phx_gen_oidcc.svg)](https://hex.pm/packages/phx_gen_oidcc)
[![Total Download](https://img.shields.io/hexpm/dt/phx_gen_oidcc.svg)](https://hex.pm/packages/phx_gen_oidcc)
[![License](https://img.shields.io/hexpm/l/phx_gen_oidcc.svg)](https://github.com/erlef/phx_gen_oidcc/blob/main/LICENSE)
[![Last Updated](https://img.shields.io/github/last-commit/erlef/phx_gen_oidcc.svg)](https://github.com/erlef/phx_gen_oidcc/commits/master)
[![Coverage Status](https://coveralls.io/repos/github/erlef/phx_gen_oidcc/badge.svg?branch=main)](https://coveralls.io/github/erlef/phx_gen_oidcc?branch=main)
OpenID Certified by [Jonatan Männchen](https://github.com/maennchen) at the
[Erlang Ecosystem Foundation](https://github.com/erlef) of multiple Relaying
Party conformance profiles of the OpenID Connect protocol:
For details, check the
[Conformance Test Suite](https://github.com/erlef/oidcc_conformance).
The development of the library and the certification is funded as an
[Erlang Ecosystem Foundation](https://erlef.org/) stipend entered by the
[Security Working Group](https://erlef.org/wg/security).
This library has taken some inspiration from
[@aaronrenner](https://github.com/aaronrenner)'s
[`phx_gen_auth`](https://github.com/aaronrenner/phx_gen_auth).## Overview
The purpose of `phx.gen.oidcc` is to generate a pre-built authentication system
into a Phoenix 1.7 application that follows both security and elixir best
practices. By generating code into the user's application instead of using a
library, the user has complete freedom to modify the authentication system so it
works best with their app.## Installation
After running `mix phx.new`, `cd` into your application's directory
(ex. `my_app`).1. Add `phx_gen_oidcc` to your list of dependencies in `mix.exs`
```elixir
def deps do
[
{:phx_gen_oidcc, "~> 0.1.0", only: [:dev], runtime: false},
...
]
end
```
1. Install and compile the dependencies
```
$ mix do deps.get, deps.compile
```## Running the generator
From the root of your phoenix app, you
can install the authentication system with the following command```console
$ mix phx.gen.oidcc \
MyApp.ConfigProviderName \
"https://issuer.example.com" \
"client_id" \
"client_secret"
```This creates the templates,views, and controllers on the web namespace, and
starts a new `Oidcc.ProviderConfiguration.Worker`, in the application.Next, let's install the dependencies
```console
$ mix deps.get
```Let's run the tests and make sure our new authentication system works as
expected.```console
$ mix test
```Finally, let's start our phoenix server and try it out.
```console
$ mix phx.server
```## Learning more
To learn more about `phx.gen.oidcc`, run the following command.
```console
$ mix help phx.gen.oidcc
```You can also look up the mix task in
[hexdocs](https://hexdocs.pm/phx_gen_oidcc).