{% extends "base.html" %} {% block heading %}VKontakte application authentication{% endblock %} {% block content %} {% if user.is_anonymous %} {% if warning %}

GET request does not contain user_id and this is not something VKontakte usually does. Probably you do not use VKontakte to open this page. To do a real test you need to do following:

  1. Create your IFrame application at VKontakte.
  2. In your application settings specify your IFrame URL mysite.com/vk (current default).
  3. Because VK IFrame uses other app ID than OAuth/OpenAPI authentication one, you have to specify it and its secret key in VKAPP_* settings:
  4. VKAPP_APP_ID='iframe_app_id', VKAPP_API_SECRET='iframe_app_secret_key', VKAPP_USER_MODE = 'user_mode'
  5. user_mode values
    1. if 0 there will be no check whether a user connected to your application or not
    2. if 1 DSA will check is_app_user parameter VKontakte sends when user opens app page one time
    3. if 2 (safest) DSA will check status of user interactively (useful when you have interactive authentication via AJAX)
  6. Launch manage.py via sudo ./manage.py mysite.com:80 for browser to be able to load it when VKontakte calls IFrame URL.
  7. Open your VKontakte app page via http://vk.com/appapp_id
  8. After that you will see this page in a right way and will able to connect to application and login automatically after connection.
{% else %}

You are not authenticated at VKontakte.

Click to authenticate {% endif %} {% else %}

Authenticated successfully as {{ user }}

Done {% endif %} {% endblock %}