Method: OpenID::Server::AssociateRequest#answer
- Defined in:
- lib/openid/server.rb
#answer(assoc) ⇒ Object
Respond to this request with an association.
- assoc
-
The association to send back.
Returns a response with the association information, encrypted to the consumer’s public key if appropriate.
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/openid/server.rb', line 363 def answer(assoc) response = OpenIDResponse.new(self) response.fields.update_args(OPENID_NS, { 'expires_in' => sprintf('%d', assoc.expires_in()), 'assoc_type' => @assoc_type, 'assoc_handle' => assoc.handle, }) response.fields.update_args(OPENID_NS, @session.answer(assoc.secret)) unless (@session.session_type == 'no-encryption' and .is_openid1) response.fields.set_arg( OPENID_NS, 'session_type', @session.session_type) end return response end |