Permalink
Browse files

3. first, set up the keratin authn libraries for your server and client

  • Loading branch information...
cainlevy committed Nov 23, 2016
1 parent bf01894 commit aae06ebc1368d9ca95d55d4669ac102ef6d330d3
Showing with 43 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +26 −0 Gemfile.lock
  3. +8 −0 app.rb
  4. +8 −0 views/layout.erb
View
@@ -4,3 +4,4 @@ gem 'puma'
gem 'sqlite3'
gem 'sinatra', require: 'sinatra'
gem 'sinatra-sequel'
gem 'keratin-authn'
View
@@ -1,10 +1,31 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
bindata (2.4.0)
concurrent-ruby (1.0.5)
i18n (0.8.1)
json-jwt (1.7.1)
activesupport
bindata
multi_json (>= 1.3)
securecompare
url_safe_base64
keratin-authn (0.4.1)
json-jwt
lru_redux
lru_redux (1.1.0)
minitest (5.10.1)
multi_json (1.12.1)
puma (3.7.0)
rack (1.6.5)
rack-protection (1.5.3)
rack
securecompare (1.0.0)
sequel (4.43.0)
sinatra (1.4.8)
rack (~> 1.5)
@@ -14,12 +35,17 @@ GEM
sequel (>= 3.2.0)
sinatra (>= 0.9.4)
sqlite3 (1.3.13)
thread_safe (0.3.6)
tilt (2.0.6)
tzinfo (1.2.3)
thread_safe (~> 0.1)
url_safe_base64 (0.2.2)
PLATFORMS
ruby
DEPENDENCIES
keratin-authn
puma
sinatra
sinatra-sequel
View
8 app.rb
@@ -9,6 +9,14 @@
end
end
Keratin::AuthN.config.tap do |config|
# The base URL of your Keratin AuthN service
config.issuer = "https://keratin-authn-demo.herokuapp.com"
# The domain of your application
config.audience = 'localhost'
end
class User < Sequel::Model
end
View
@@ -10,5 +10,13 @@
</nav>
<%= yield %>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.0.5/es6-promise.auto.min.js"></script>
<script src="https://unpkg.com/keratin-authn@0.10.0/dist/keratin-authn.min.js"></script>
<script>
KeratinAuthN.setHost("<%= Keratin::AuthN.config.issuer %>");
KeratinAuthN.setCookieStore('authn');
KeratinAuthN.restoreSession().catch(console.log);
</script>
</body>
</html>

0 comments on commit aae06eb

Please sign in to comment.