2012-01-07 2 views
1

Railsでブログを設定しようとしていて、Enki www.Enkiblog.comが本当に好きです。しかし、私はOpen Idで使用する認証システムについて少し混乱しています。開発では、それはあなたが認証をバイパスすることができますが、生産のために、私がそれを単純な認証システムを組み込むことを望んだが、それは簡単ですかどうかを知りませんOpenIDサーバ enter image description hereRails:Enkiと他のログインを使用するブログの宝物

を使用する必要のようです(私は騒ぎです)、OpenIdサーバーをセットアップする方法を知りたいのであれば(インストールがもっと必要です)

私はMasqueradeと呼ばれるOpen Idサーバーを見ましたが、まったく混乱しました。私はそれがEnki(Railsエンジンのような)に組み込まれようとしているのか、まったく別のアプリケーションであるのかは分かりません。

どのようにすれば認証を簡単にすることができますか、それともどのようにして簡単にしてnoobが使用できるようにすることができますか?

この

はエンキにOpenID認証のために設定しenki.ymlファイルです

# Configuration options for your blog - customise to taste 
    # This file contains no secret information, so can be stored in source control (unlike database.yml) 
    title: My Enki Blog 
    url: http://enkiblog.com 
    author: 
     name: Don Alias  # For copyright notice and ATOM feeds 
     email: [email protected] # Exception emails will go here, and it is used in ATOM feeds 
     open_id:     # These are used to login to the admin area 
      - http://enkiblog.com 
      - http://secondaryopenid.com 

    # Delete the following section if your site will not be acting as an OpenID delegate (http://wiki.openid.net/Delegation) 
    # If you're deploying with mongrel, make sure you read http://rhnh.net/2008/04/13/nginx-openid-delegation-and-yadis 
    open_id_delegation: 
     server: http://www.myopenid.com/server 
     delegate: http://username.myopenid.com 

これで

def create 
    return successful_login if allow_login_bypass? && params[:bypass_login] 

    if params[:openid_url].blank? && !request.env[Rack::OpenID::RESPONSE] 
     flash.now[:error] = "You must provide an OpenID URL" 
     render :action => 'new' 
    else 
     authenticate_with_open_id(params[:openid_url]) do |result, identity_url| 
     if result.successful? 
      if enki_config.author_open_ids.include?(URI.parse(identity_url)) 
      return successful_login 
      else 
      flash.now[:error] = "You are not authorized" 
      end 
     else 
      flash.now[:error] = result.message 
     end 
     render :action => 'new' 
     end 
    end 
    end 
+0

同じ問題が発生しています。私は正常にmyopenid.comにサインアップし、それに満足しており、それに固執したいと思います。私は解決策が最終的に見つけられることを願う。 –

+0

これは私の問題を解決しました:http://stackoverflow.com/questions/2683611/open-id-authentication-openidauthentication-store-is-nil-using-in-memory-sto –

答えて

0

は、すべてあなたが必要とする認証を行う管理者/セッションコントローラからcreateアクションGoogleのオープンID(あなたのプロフィールのURL)またはオープンIDプロバイダのいずれかがopenid.netです。オープンIDのURLを見つけたら、config/enki.ymlを開いて、オープンIDの値をオープンIDのURLに変更するだけです。例:

open_id:     # These are used to login to the admin area 
    - https://plus.google.com/102381073183096542549 

管理パネルでログインするには、プロフィールのURLを入力してください。 google.comなどのオープンIDプロバイダのサイトにログインし、yourblog.comの権限を依頼することがあります。許可されると、管理者アクセス権が与えられます。あなたがenki.ymlのopen_idにそれを制限しているので、誰も管理エリアにアクセスすることができません。

-1

実際にコードをハックすることでEnkiからOpenID認証を取り除くことができます。私はこれを行うことができました(初心者のRails)ので、それほど難しいことではありません。

これだけの問題は、あなた自身がEnkiコードを更新していることです。これを達成するためにはかなりの変更がありました。

関連する問題