class OpenID::Server::ProtocolError
A message did not conform to the OpenID protocol.
Attributes
contact[RW]
openid_message[RW]
The query that is failing to be a valid OpenID request.
reference[RW]
Public Class Methods
new(message, text=nil, reference=nil, contact=nil)
click to toggle source
- text
-
A message about the encountered error.
Calls superclass method
# File lib/openid/server.rb, line 1394 def initialize(message, text=nil, reference=nil, contact=nil) @openid_message = message @reference = reference @contact = contact Util.assert(!message.is_a?(String)) super(text) end
Public Instance Methods
encode_to_kvform()
click to toggle source
# File lib/openid/server.rb, line 1441 def encode_to_kvform return to_message().to_kvform() end
encode_to_url()
click to toggle source
implements IEncodable
# File lib/openid/server.rb, line 1437 def encode_to_url return to_message().to_url(get_return_to()) end
get_return_to()
click to toggle source
Get the return_to argument from the request, if any.
# File lib/openid/server.rb, line 1403 def get_return_to if @openid_message.nil? return nil else return @openid_message.get_arg(OPENID_NS, 'return_to') end end
has_return_to()
click to toggle source
Did this request have a return_to parameter?
# File lib/openid/server.rb, line 1412 def has_return_to return !get_return_to.nil? end
to_form_markup()
click to toggle source
# File lib/openid/server.rb, line 1445 def to_form_markup return to_message().to_form_markup(get_return_to()) end
to_html()
click to toggle source
# File lib/openid/server.rb, line 1449 def to_html return Util.auto_submit_html(to_form_markup) end
to_message()
click to toggle source
Generate a Message object for sending to the relying party, after encoding.
# File lib/openid/server.rb, line 1418 def to_message namespace = @openid_message.get_openid_namespace() reply = Message.new(namespace) reply.set_arg(OPENID_NS, 'mode', 'error') reply.set_arg(OPENID_NS, 'error', self.to_s) if @contact reply.set_arg(OPENID_NS, 'contact', @contact.to_s) end if @reference reply.set_arg(OPENID_NS, 'reference', @reference.to_s) end return reply end
which_encoding()
click to toggle source
How should I be encoded?
Returns one of ENCODE_URL, ENCODE_KVFORM, or None. If None, I cannot be encoded as a protocol message and should be displayed to the user.
# File lib/openid/server.rb, line 1458 def which_encoding if has_return_to() if @openid_message.is_openid2 and encode_to_url().length > OPENID1_URL_LIMIT return ENCODE_HTML_FORM else return ENCODE_URL end end if @openid_message.nil? return nil end mode = @openid_message.get_arg(OPENID_NS, 'mode') if mode if !BROWSER_REQUEST_MODES.member?(mode) return ENCODE_KVFORM end end # If your request was so broken that you didn't manage to # include an openid.mode, I'm not going to worry too much # about returning you something you can't parse. return nil end