File: ultraauth.rb

package info (click to toggle)
ruby-omniauth-ultraauth 0.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 140 kB
  • sloc: ruby: 38; sh: 4; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'omniauth'
require 'omniauth_openid_connect'

module OmniAuth
  module Strategies
    class UltraAuth < OmniAuth::Strategies::OpenIDConnect

      args %i[identifier secret]

      option :identifier, nil
      option :secret, nil
      option :name, 'ultraauth'
      option :scope, [:openid]
      option :discovery, "true"
      option :response_type, :code
      option :issuer, "https://srv.qryp.to/op"
      option :client_auth_method, :basic

      info do
        {
          username: uid
        }
      end

      private

      def client_options
        options.client_options.merge!(identifier: options.identifier, secret: options.secret)
      end
    end
  end
end
OmniAuth.config.add_camelization('ultraauth', 'UltraAuth')