Class: OpenIDConnect::Discovery::Principal
- Inherits:
-
Object
- Object
- OpenIDConnect::Discovery::Principal
- Defined in:
- lib/openid_connect/discovery/principal.rb,
lib/openid_connect/discovery/principal/uri.rb,
lib/openid_connect/discovery/principal/xri.rb,
lib/openid_connect/discovery/principal/email.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/openid_connect/discovery/principal.rb', line 4 def host @host end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/openid_connect/discovery/principal.rb', line 4 def identifier @identifier end |
Class Method Details
.parse(identifier) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/openid_connect/discovery/principal.rb', line 6 def self.parse(identifier) raise InvalidIdentifier.new('Identifier Required') if identifier.blank? type = case identifier when /^(=|@|!)/ XRI when /@/ Email else URI end type.new identifier end |
Instance Method Details
#discover!(cache_options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/openid_connect/discovery/principal.rb', line 19 def discover!( = {}) SWD.discover!( :principal => identifier, :service => Provider::SERVICE_URI, :host => host, :cache => ) rescue SWD::Exception => e raise DiscoveryFailed.new(e.) end |