Method: OpenID::Server::AssociateRequest#answer_unsupported

Defined in:
lib/openid/server.rb

#answer_unsupported(message, preferred_association_type = nil, preferred_session_type = nil) ⇒ Object

Respond to this request indicating that the association type or association session type is not supported.



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/openid/server.rb', line 383

def answer_unsupported(message, preferred_association_type=nil,
                       preferred_session_type=nil)
  if @message.is_openid1()
    raise ProtocolError.new(@message)
  end

  response = OpenIDResponse.new(self)
  response.fields.set_arg(OPENID_NS, 'error_code', 'unsupported-type')
  response.fields.set_arg(OPENID_NS, 'error', message)

  if preferred_association_type
    response.fields.set_arg(
        OPENID_NS, 'assoc_type', preferred_association_type)
  end

  if preferred_session_type
    response.fields.set_arg(
        OPENID_NS, 'session_type', preferred_session_type)
  end

  return response
end