がるの健忘録

エンジニアでゲーマーで講師で占い師なおいちゃんのブログです。

認証系設定の仮まとめ

認証の基本知識はこっち見て。
http://d.hatena.ne.jp/gallu/20080203/p1


以下、authentication(個体認証)。
基本、login.incとかいうブツん中にあるざんす。メソッド位置的にはpublic function initialize() 内。
一般的な、ID+Passwordでのログイン:front用なので、email + passになる。

  // 本人認定の種類
  // ID + Password
  $this->authentication_type_ipass();

  // 本人認証の設定各種
  //$this->set_cgi_name_id();
  //$this->set_cgi_name_pass();
  //
  //$this->set_client_clump_name();
  //$this->set_auth_user_clump_name();
  //
  //$this->set_password_hash_type('sha-1');
  $this->set_authentication_user_clump_name('auth_user_clump');


管理画面系の、auth系テーブルのIDを直に使う系

  // 本人認定の種類
  // ID + Password
  $this->authentication_type_direct_ipass();

  // 本人認証の設定各種
  //$this->set_cgi_name_id();
  //$this->set_cgi_name_pass();
  //
  //$this->set_client_clump_name();
  //$this->set_auth_user_clump_name();
  //
  //$this->set_password_hash_type('sha-1');
  $this->set_authentication_user_clump_name('auth_admin_user_clump');



  // initialize で認証するから、より上位で設定を先にしてから parent をcall
  parent::initialize();


以下、authorization(認証状態の継続)。
大抵、commonにある「各基底クラス」のinitializeメソッドでやるよねぇ。


Cookieによる認証維持。

  // 認証継続の種類
  $this->authorization_type_cookie();

  // 認証継続の設定
  //$this->authorization_cookie_name('k');
  $this->set_authorization_crypt_key('any crypted key string');
  $this->set_authorization_expire_flg(1);
  $this->set_authorization_expire(60 * 60);
  $this->set_authorization_clump_name('session_clump');

  // initialize で認証するから、より上位で設定を先にしてから parent をcall
  parent::initialize();


携帯にありがちな「契約者固有ID」での処理

  // 認証継続の種類
  $this->authorization_type_contractor_id();

  // 認証継続の設定
  $this->set_login_error_command('error');

  // initialize で認証するから、より上位で設定を先にしてから parent をcall
  parent::initialize();


以上本気でただの覚え書き。