Class: OmniauthOidc::ResponseObjects::UserInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/oidc/response_objects.rb

Overview

Represents OIDC UserInfo response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserInfo



54
55
56
# File 'lib/omniauth/oidc/response_objects.rb', line 54

def initialize(attributes = {})
  @raw_attributes = attributes.is_a?(Hash) ? attributes : attributes.to_h
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object

Allow method-style access to custom claims



140
141
142
143
144
# File 'lib/omniauth/oidc/response_objects.rb', line 140

def method_missing(method_name, *args)
  return raw_attributes[method_name.to_s] if raw_attributes.key?(method_name.to_s)

  super
end

Instance Attribute Details

#raw_attributesObject (readonly)

Returns the value of attribute raw_attributes.



52
53
54
# File 'lib/omniauth/oidc/response_objects.rb', line 52

def raw_attributes
  @raw_attributes
end

Instance Method Details

#addressObject



131
132
133
# File 'lib/omniauth/oidc/response_objects.rb', line 131

def address
  raw_attributes["address"]
end

#birthdateObject



111
112
113
# File 'lib/omniauth/oidc/response_objects.rb', line 111

def birthdate
  raw_attributes["birthdate"]
end

#emailObject



99
100
101
# File 'lib/omniauth/oidc/response_objects.rb', line 99

def email
  raw_attributes["email"]
end

#email_verifiedObject



103
104
105
# File 'lib/omniauth/oidc/response_objects.rb', line 103

def email_verified
  raw_attributes["email_verified"]
end

#family_nameObject



71
72
73
# File 'lib/omniauth/oidc/response_objects.rb', line 71

def family_name
  raw_attributes["family_name"]
end

#genderObject



107
108
109
# File 'lib/omniauth/oidc/response_objects.rb', line 107

def gender
  raw_attributes["gender"]
end

#given_nameObject



67
68
69
# File 'lib/omniauth/oidc/response_objects.rb', line 67

def given_name
  raw_attributes["given_name"]
end

#localeObject



119
120
121
# File 'lib/omniauth/oidc/response_objects.rb', line 119

def locale
  raw_attributes["locale"]
end

#middle_nameObject



75
76
77
# File 'lib/omniauth/oidc/response_objects.rb', line 75

def middle_name
  raw_attributes["middle_name"]
end

#nameObject



63
64
65
# File 'lib/omniauth/oidc/response_objects.rb', line 63

def name
  raw_attributes["name"]
end

#nicknameObject



79
80
81
# File 'lib/omniauth/oidc/response_objects.rb', line 79

def nickname
  raw_attributes["nickname"]
end

#phone_numberObject



123
124
125
# File 'lib/omniauth/oidc/response_objects.rb', line 123

def phone_number
  raw_attributes["phone_number"]
end

#phone_number_verifiedObject



127
128
129
# File 'lib/omniauth/oidc/response_objects.rb', line 127

def phone_number_verified
  raw_attributes["phone_number_verified"]
end

#pictureObject



91
92
93
# File 'lib/omniauth/oidc/response_objects.rb', line 91

def picture
  raw_attributes["picture"]
end

#preferred_usernameObject



83
84
85
# File 'lib/omniauth/oidc/response_objects.rb', line 83

def preferred_username
  raw_attributes["preferred_username"]
end

#profileObject



87
88
89
# File 'lib/omniauth/oidc/response_objects.rb', line 87

def profile
  raw_attributes["profile"]
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean



146
147
148
# File 'lib/omniauth/oidc/response_objects.rb', line 146

def respond_to_missing?(method_name, include_private = false)
  raw_attributes.key?(method_name.to_s) || super
end

#subObject

Standard OIDC claims



59
60
61
# File 'lib/omniauth/oidc/response_objects.rb', line 59

def sub
  raw_attributes["sub"]
end

#updated_atObject



135
136
137
# File 'lib/omniauth/oidc/response_objects.rb', line 135

def updated_at
  raw_attributes["updated_at"]
end

#websiteObject



95
96
97
# File 'lib/omniauth/oidc/response_objects.rb', line 95

def website
  raw_attributes["website"]
end

#zoneinfoObject



115
116
117
# File 'lib/omniauth/oidc/response_objects.rb', line 115

def zoneinfo
  raw_attributes["zoneinfo"]
end