Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token_auth problem on dashboard gadgets #9929

Closed
vtsanev opened this issue Mar 15, 2016 · 1 comment
Closed

token_auth problem on dashboard gadgets #9929

vtsanev opened this issue Mar 15, 2016 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Milestone

Comments

@vtsanev
Copy link

vtsanev commented Mar 15, 2016

When you use token_auth for authentication on Piwik dashboard the gadgets don't open with error meesage: "Error: You can't access this resource as it requires an 'view' access for the website id = X"
We do a redirection from our site to our Piwik instance specifying good idSite and token_auth:
http://our_piwik_domain/index.php?module=CoreHome&action=index&idSite=X&period=day&date=yesterday&token_auth=some_user_token

The user information is actually loaded but the gadgets don't open.
I've found out a way to fix the problem:
In broadcast.js(line 491):

var ajax = new ajaxHelper();
ajax.setUrl(urlAjax);
ajax._getDefaultPostParams = function () {
    return {};
};

The function _getDefaultPostParams from ajaxHelper.js is overwritten in broadcast.js. When I remove the overwritten version in broadcast.js it works good.

@tsteur
Copy link
Member

tsteur commented Mar 16, 2016

To log them in via redirect directly the logme feature is supposed to be used see http://piwik.org/faq/how-to/faq_30/

Only specifying the token_auth is not supposed to work for this. However, the token_auth can be used for exported widgets and in API calls, but not to log someone in.

@tsteur tsteur closed this as completed Mar 16, 2016
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Mar 16, 2016
@tsteur tsteur added this to the 2.16.1 milestone Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants