diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-28 20:05:47 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-28 20:05:47 +0200 |
commit | 1a4b7178b9d62ab33b91819ea0de9a90f4781750 (patch) | |
tree | 0c833a69a39774af0ea7ae220951e9f937d89288 | |
parent | e714c87047ba7b3ea267d35e615842732f075386 (diff) | |
download | reclaim-oidc-1a4b7178b9d62ab33b91819ea0de9a90f4781750.tar.gz reclaim-oidc-1a4b7178b9d62ab33b91819ea0de9a90f4781750.zip |
0.0.4
-rw-r--r-- | lib/reclaim_oidc.rb | 14 | ||||
-rw-r--r-- | reclaim-oidc.gemspec | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/reclaim_oidc.rb b/lib/reclaim_oidc.rb index 4ba55aa..c28eeea 100644 --- a/lib/reclaim_oidc.rb +++ b/lib/reclaim_oidc.rb | |||
@@ -41,11 +41,11 @@ class ReclaimOidc | |||
41 | def add_client(name,redirect_uri,description) | 41 | def add_client(name,redirect_uri,description) |
42 | raise if redirect_uri.nil? or description.nil? or name.nil? | 42 | raise if redirect_uri.nil? or description.nil? or name.nil? |
43 | uri = URI(@url + '/identity') | 43 | uri = URI(@url + '/identity') |
44 | payload = {'name' => "#{name}"}.to_json | 44 | payload = {'name' => "#{name}"} |
45 | #resp = Net::HTTP.post(uri, payload) | 45 | #resp = Net::HTTP.post(uri, payload) |
46 | req = Net:HTTP::Post.new(uri, payload) | 46 | #req = Net::HTTP::Post.new(uri, payload.to_json) |
47 | Net::HTTP.start(uri.host, uri.port) do |http| | 47 | Net::HTTP.start(uri.host, uri.port) do |http| |
48 | resp = http.request req | 48 | resp = http.post(uri.path, payload.to_json) |
49 | end | 49 | end |
50 | uri = URI(@url + "/namestore/#{name}") | 50 | uri = URI(@url + "/namestore/#{name}") |
51 | record = {'record_type' => "RECLAIM_OIDC_CLIENT", | 51 | record = {'record_type' => "RECLAIM_OIDC_CLIENT", |
@@ -54,19 +54,19 @@ class ReclaimOidc | |||
54 | 'expiration_time' => "1d", | 54 | 'expiration_time' => "1d", |
55 | 'flag' => 8} | 55 | 'flag' => 8} |
56 | #resp = Net::HTTP.post(uri,record.to_json) | 56 | #resp = Net::HTTP.post(uri,record.to_json) |
57 | req = Net:HTTP::Post.new(uri, record.to_json) | 57 | #req = Net::HTTP::Post.new(uri, record) |
58 | Net::HTTP.start(uri.host, uri.port) do |http| | 58 | Net::HTTP.start(uri.host, uri.port) do |http| |
59 | resp = http.request req | 59 | resp = http.post(uri.path,record.to_json) |
60 | end | 60 | end |
61 | record = {'record_type' => "RECLAIM_OIDC_REDIRECT", | 61 | record = {'record_type' => "RECLAIM_OIDC_REDIRECT", |
62 | 'value' => redirect_uri, | 62 | 'value' => redirect_uri, |
63 | 'record_name' => "@", | 63 | 'record_name' => "@", |
64 | 'expiration_time' => "1d", | 64 | 'expiration_time' => "1d", |
65 | 'flag' => 8} | 65 | 'flag' => 8} |
66 | req = Net:HTTP::Post.new(uri, record.to_json) | 66 | #req = Net::HTTP::Post.new(uri, record) |
67 | #resp = Net::HTTP.post(uri,record.to_json) | 67 | #resp = Net::HTTP.post(uri,record.to_json) |
68 | Net::HTTP.start(uri.host, uri.port) do |http| | 68 | Net::HTTP.start(uri.host, uri.port) do |http| |
69 | resp = http.request req | 69 | resp = http.post(uri.path,record.to_json) |
70 | end | 70 | end |
71 | end | 71 | end |
72 | def delete_client(name) | 72 | def delete_client(name) |
diff --git a/reclaim-oidc.gemspec b/reclaim-oidc.gemspec index 3363855..0dfb0c7 100644 --- a/reclaim-oidc.gemspec +++ b/reclaim-oidc.gemspec | |||
@@ -1,6 +1,6 @@ | |||
1 | Gem::Specification.new do |s| | 1 | Gem::Specification.new do |s| |
2 | s.name = 'reclaim-oidc' | 2 | s.name = 'reclaim-oidc' |
3 | s.version = '0.0.2' | 3 | s.version = '0.0.4' |
4 | s.date = '2019-04-28' | 4 | s.date = '2019-04-28' |
5 | s.summary = "re:claimID OpenID Connect CLI" | 5 | s.summary = "re:claimID OpenID Connect CLI" |
6 | s.description = "Used to manage re:claimID OpenID Connect clients and OpenID Connect Provider configuration(s)" | 6 | s.description = "Used to manage re:claimID OpenID Connect clients and OpenID Connect Provider configuration(s)" |