Module: Riddl::Utils::OAuth2::UnivieApp

Defined in:
lib/ruby/riddl/utils/oauth2-univie.rb

Defined Under Namespace

Classes: RefreshToken, RevokeFlow, VerifyIdentity

Class Method Summary collapse

Class Method Details

.implementation(client_id, client_secret, access_tokens, refresh_tokens, codes, adur, rdur) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ruby/riddl/utils/oauth2-univie.rb', line 61

def self::implementation(client_id, client_secret, access_tokens, refresh_tokens, codes, adur, rdur)
  Proc.new do
    run UnivieBearer::CheckAuth, client_id, client_secret, access_tokens if get 'check'
    on resource 'verify' do
      run VerifyIdentity, access_tokens, refresh_tokens, codes, client_id, client_secret, adur, rdur if post 'verify_in'
    end
    on resource 'token' do
      run RefreshToken, access_tokens, refresh_tokens, client_id, client_secret, adur, rdur if post 'refresh_token_in'
    end
    on resource 'revoke' do
      run RevokeFlow, access_tokens, refresh_tokens, codes if delete 'revoke_in'
    end
  end
end