From 86df2e3b938d1a47deec8c424a30bb3297f9e521 Mon Sep 17 00:00:00 2001 From: Joshua Azemoh Date: Thu, 31 Oct 2019 01:44:46 +0100 Subject: [PATCH] Add comments about signing config to initializer --- README.md | 17 +++++++++++++++++ lib/generators/scim_rails/templates/initializer.rb | 10 ++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 5e04d02..fd7a5f5 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,23 @@ When sending requests to the server the `Content-Type` should be set to `applica All responses will be sent with a `Content-Type` of `application/scim+json`. +#### Authentication + +This gem supports both basic and OAuth bearer authentication. + +##### Basic Auth + +```bash +$ curl -X GET 'http://username:password@localhost:3000/scim/v2/Users' +``` + +##### OAuth Bearer + +```bash +$ curl -H 'Authorization: Bearer xxxxxxx.xxxxxx' -X GET 'http://localhost:3000/scim/v2/Users' +``` + + ### List ##### All diff --git a/lib/generators/scim_rails/templates/initializer.rb b/lib/generators/scim_rails/templates/initializer.rb index b76111e..6a70207 100644 --- a/lib/generators/scim_rails/templates/initializer.rb +++ b/lib/generators/scim_rails/templates/initializer.rb @@ -22,6 +22,16 @@ ScimRails.configure do |config| # or throws an error (returning 409 Conflict in accordance with SCIM spec) config.scim_user_prevent_update_on_create = false + # Cryptographic algorithm used for signing the auth token. + # It supports all algorithms supported by the jwt gem. + # See https://github.com/jwt/ruby-jwt#algorithms-and-usage for supported algorithms + # It is "none" by default, hence generated tokens are unsigned + # config.signing_algorithm = "HS256" + + # Secret token used to sign authorization tokens + # It is `nil` by default, hence generated tokens are unsigned + # config.signing_secret = SECRET_TOKEN + # Default sort order for pagination is by id. If you # use non sequential ids for user records, uncomment # the below line and configure a determinate order. -- libgit2 0.21.0