-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Openid Connect implementation (#262)
* Openidconnect implementation
- Loading branch information
Showing
14 changed files
with
510 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ db/* | |
.envrc | ||
static/dist/ | ||
node_modules/ | ||
keys/*.pem |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ maximum_pending_users = 25 | |
|
||
[debug] | ||
secret_key = "1vwCFFPSdQya895gNiO556SzmfShG6MokstgttLvwjw=" | ||
ec_private_key = "keys/jwt_key.pem" | ||
bcrypt_cost = 4 | ||
seed_database = true | ||
|
||
|
@@ -29,6 +30,8 @@ port = 8000 | |
# Values you want to fill in for production use | ||
# admin_email = # Email address to send admin notifications to (e.g. [email protected]) | ||
# secret_key = # used to encrypt cookies (generate a new one!) | ||
# ec_private_key = # Path to ECDSA private key for signing jwt's. Key Algo needs to be ES384 in PKCS#8 form. | ||
# generate by running: openssl ecparam -genkey -noout -name secp384r1 | openssl pkcs8 -topk8 -nocrypt -out ec-private.pem) | ||
# base_url = # URL where the application is hosten (e.g. https://auth.zeus.gent) | ||
# mail_from = # From header to set when sending emails (e.g. [email protected]) | ||
# mail_server = # domain of the SMTP server used to send mail (e.g. smtp.zeus.gent) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::Path; | ||
|
||
use openssl::ec::{EcGroup, EcKey}; | ||
use openssl::nid::Nid; | ||
use openssl::pkey::PKey; | ||
|
||
fn main() { | ||
let path = Path::new("keys/jwt_key.pem"); | ||
if !path.exists() { | ||
let group = EcGroup::from_curve_name(Nid::SECP384R1).unwrap(); | ||
let pkey = PKey::from_ec_key(EcKey::generate(&group).unwrap()).unwrap(); | ||
let mut f = File::create(path).unwrap(); | ||
let pem = pkey.private_key_to_pem_pkcs8().unwrap(); | ||
f.write_all(&pem).unwrap(); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.