Skip to content

Commit

Permalink
Fixing VK APP authentication and app page text with new VKAPP_* settings
Browse files Browse the repository at this point in the history
  • Loading branch information
krvss committed Jun 26, 2013
1 parent 5217c9d commit e0a8dfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions example/example/templates/vkontakte_app.html
Expand Up @@ -35,9 +35,8 @@
<ol>
<li>Create your IFrame application at <a href="https://http://vk.com/apps.php?act=add">VKontakte</a>.</li>
<li>In your application settings specify your IFrame URL <b>mysite.com</b>/vk (current default). </li>
<li>Because VKontakte IFrame uses other app ID than OAuth/OpenAPI authentication one, you have to specify it and its secret key in VKONTAKTE_APP_AUTH setting:</li>
<li><b>VKONTAKTE_APP_AUTH={'key':'iframe_app_secret_key', 'user_mode': 2, 'id':'iframe_app_id'}</b></li></li>
<li><b>user_mode</b> values</li>
<li>Because VK IFrame uses other app ID than OAuth/OpenAPI authentication one, you have to specify it and its secret key in VKAPP_* settings:</li>
<li>VKAPP_APP_ID=<b>'iframe_app_id'</b>, VKAPP_API_SECRET=<b>'iframe_app_secret_key'</b>, VKAPP_USER_MODE = <b>'user_mode'</b></li></li> <li><b>user_mode</b> values</li>
<ol>
<li>if 0 there will be no check whether a user connected to your application or not</li>
<li>if 1 DSA will check is_app_user parameter VKontakte sends when user opens app page one time</li>
Expand Down
5 changes: 3 additions & 2 deletions social_auth/backends/contrib/vk.py
Expand Up @@ -34,6 +34,8 @@
LOCAL_HTML = setting('VK_LOCAL_HTML', setting('VKONTAKTE_LOCAL_HTML',
'vkontakte.html'))

USE_APP_AUTH = setting('VKAPP_APP_ID', False)


class VKOpenAPIBackend(SocialAuthBackend):
"""VK OpenAPI authentication backend"""
Expand Down Expand Up @@ -298,6 +300,5 @@ def vk_api(method, data, is_app=False):
# Backend definition
BACKENDS = {
'vk-openapi': VKOpenAPIAuth,
'vk-oauth': VKOAuth2,
'vk-app': VKAppAuth
'vk-oauth': VKOAuth2 if not USE_APP_AUTH else VKAppAuth,
}

0 comments on commit e0a8dfa

Please sign in to comment.