| | 398 | |
|---|
| | 399 | __END__ |
|---|
| | 400 | |
|---|
| | 401 | =head1 NAME |
|---|
| | 402 | |
|---|
| | 403 | MT::Auth::OpenID |
|---|
| | 404 | |
|---|
| | 405 | Movable Type commenter authentication module via OpenID |
|---|
| | 406 | |
|---|
| | 407 | =head1 METHODS |
|---|
| | 408 | |
|---|
| | 409 | =head2 login |
|---|
| | 410 | |
|---|
| | 411 | This method is called from MT::App::Comments::login_external, |
|---|
| | 412 | to initiate process of logging in to a website other than |
|---|
| | 413 | Movable Type itself. You should not have to modify the |
|---|
| | 414 | behavior of this method. |
|---|
| | 415 | |
|---|
| | 416 | =head2 handle_sign_in |
|---|
| | 417 | |
|---|
| | 418 | This method is called from MT::App::Comments::handle_sign_in |
|---|
| | 419 | to accept the result of logging in to an external website. |
|---|
| | 420 | You should not have to modify the behavior of this method. |
|---|
| | 421 | |
|---|
| | 422 | =head2 url_for_userid |
|---|
| | 423 | |
|---|
| | 424 | This method is called in login method when it needs to construct |
|---|
| | 425 | OpenID for the login request. By default the module accepts |
|---|
| | 426 | the identifier entered by the user as OpenID, thus does nothing |
|---|
| | 427 | in this method. |
|---|
| | 428 | |
|---|
| | 429 | You can inherit this class, create your own authentication |
|---|
| | 430 | module and override this method to generate OpenID out of |
|---|
| | 431 | what user entered in the login form, so it can provide more |
|---|
| | 432 | user friendly way of specifying their OpenID. See MT::Auth::Vox |
|---|
| | 433 | and MT::Auth::LiveJournal for examples. |
|---|
| | 434 | |
|---|
| | 435 | =head2 get_nickname |
|---|
| | 436 | |
|---|
| | 437 | This method is called in handle_sign_in method, in which it |
|---|
| | 438 | tries to grab the user's nickname. By default, a user who |
|---|
| | 439 | is authenticated via OpenID has his/her nickname as the OpenID |
|---|
| | 440 | (thus, URL). It tends to get ugly when it is displayed. |
|---|
| | 441 | |
|---|
| | 442 | By default, this class tries to load FOAF or Atom from the |
|---|
| | 443 | verified OpenID to see if it is able to get more semantic information. |
|---|
| | 444 | If it was able to load the semantic info from one of them, |
|---|
| | 445 | it uses the information as the user's nickname. |
|---|
| | 446 | |
|---|
| | 447 | You can inherit this class, create your own authentication |
|---|
| | 448 | module and override this method to generate more user friendly |
|---|
| | 449 | nickname for a user from the OpenID that does not support |
|---|
| | 450 | FOAF or Atom retrieval from the URL. |
|---|
| | 451 | |
|---|
| | 452 | =head2 get_userpic_asset |
|---|
| | 453 | |
|---|
| | 454 | This method is called in handle_sign_in method, in which it |
|---|
| | 455 | tries to retrieve the user's userpic or avatar. By default, |
|---|
| | 456 | the method sees if the FOAF retrieved from OpenID has the URL |
|---|
| | 457 | for userpic. If it does, the method downloads the userpic and |
|---|
| | 458 | saves it as an userpic asset for the user. |
|---|
| | 459 | |
|---|
| | 460 | You can inherit this class, create your own authentication |
|---|
| | 461 | module and override this method to associate a userpic to the user. |
|---|
| | 462 | |
|---|
| | 463 | =head2 check_url_params |
|---|
| | 464 | |
|---|
| | 465 | This method is called in login method. This method must return |
|---|
| | 466 | a hash which is passed to I<Net::OpenID::ClaimedIdentity>::check_url. |
|---|
| | 467 | Consult I<Net::OpenID::ClaimedIdentity> about what can be specified. |
|---|
| | 468 | By default, the class specifies trust_root and return_to parameters. |
|---|
| | 469 | |
|---|
| | 470 | You can inherit this class, create your own authentication |
|---|
| | 471 | module and override this method to specify more parameters, or |
|---|
| | 472 | change how to construct trust_root and return_to arguments. |
|---|
| | 473 | |
|---|
| | 474 | =head1 AUTHOR & COPYRIGHT |
|---|
| | 475 | |
|---|
| | 476 | Please see L<MT/AUTHOR & COPYRIGHT>. |
|---|
| | 477 | |
|---|
| | 478 | =cut |
|---|