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

Random logme error #14544

Closed
bizpp4253 opened this issue Jun 19, 2019 · 13 comments
Closed

Random logme error #14544

bizpp4253 opened this issue Jun 19, 2019 · 13 comments
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@bizpp4253
Copy link

bizpp4253 commented Jun 19, 2019

Issue listed @ https://forum.matomo.org/t/random-logme-error/33230

Heres the logic I used to implement LogMe ..

  if( ( session_status() !== PHP_SESSION_ACTIVE ) 
   or 
     ( (! isset($_COOKIE['MyCookie'] ) ) or ($_COOKIE['MyMcookie'] != "ok")) )
	{
		require_once 'customLogMein.php';
	}

customLogMein.php---->

$furl = host url; 
$authURL = 'https://sso_login_page_url?retURL='.$furl; 


$userId = "abcd1234";
$hashuserIdPass = hash('md5',$userId);

//Check if cookie is expired else redirect to SSO Logn page
if (! isset( $_COOKIE['MyMcookie'] ) ) { 
	redirect to SSO log in page
}	

/* build new URL with logme data and redirect to it.  */
if 	(! isset($_COOKIE[$MyMcookie] ) ) {
	$curURL = $furl;
	$LogmeURL = $curURL.'?module=Login&action=logme&login='.$userId.'&password='.$hashuserIdPass;
	header( 'HTTP/1.0 302 Redirect' ); 
	header( "Location: ".$LogmeURL ); 
	header( "Connection: close" );
	exit;
@tsteur
Copy link
Member

tsteur commented Jun 20, 2019

Are you using the latest Matomo version? If not, please update. Can you login using the same userid/password?

I tried it, and it works fine for me. Maybe an update fixes the issue or maybe you have an issue with your server or browser. From what you wrote in the forum this looks otherwise rather like an issue on your side.

@bizpp4253
Copy link
Author

bizpp4253 commented Jun 24, 2019

Yep.. using the latest Matomo version 3.x .
The issue is : Its erratic . First Login works right 100% of the time.
Its after u have logged in , its on and off ... meaning it may or may not work any next click in the UI [anywhere].. the same may work sometimes and all of sudden it may give error.

@bizpp4253
Copy link
Author

Hi there.. is this something that is being looked at or share the solution for it to work consistently ?
Help is much appreciated!

@tsteur
Copy link
Member

tsteur commented Jun 26, 2019

I'm unable to reproduce it which makes it a problem. Can you reproduce it when you go into incognito mode and then open the generated URL for module=Login&action=logme&login='.$userId.'&password='.$hashuserIdPass; yourself manually in the browser?
`

@bizpp4253
Copy link
Author

I am not clear on what you are asking.. but i opened the url in incongnitoe mode .. Heres what i see ..

  1. Login was successful in first attempt.
  2. Clicking in different secitons of the UI worked .
  3. Sudden failure when clicking in one section which worked a few clicks before...
  4. Below is the url which gave me the "Action 'logme' not found in the module 'Live'" error..

https://website/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#?idSite=1&period=day&date=yesterday&category=General_Visitors&subcategory=General_RealTime

@bizpp4253
Copy link
Author

Oh i see what u mean .. let me try ..

@bizpp4253
Copy link
Author

  1. https://website:443/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

The above url then redirects to my singlesignon and after successful authentication, it redirects back to the below url which is the default Matomo Login screen with an error message..

  1. https://website/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday?module=Login&action=logme&login=userid&password=hashedpassword

  2. Error message - Error: You can't access this resource as it requires 'view' access for the website id = 1.

@bizpp4253
Copy link
Author

I also tried the below.. in incognito mode..

  1. Logged in and authenticated with the SSO . Was able to load the Landing page of Matomo.
  2. on 2nd tab, attempted to load the same using the below url ..
    https://website/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday?module=Login&action=logme&login=userid&password=hashedpassword

gives me "Action 'logme' not found in the module 'CoreHome'"

@tsteur
Copy link
Member

tsteur commented Jun 28, 2019

Are you using a plugin in Matomo re these SSO redirects?

@mattab mattab added this to the 3.12.0 milestone Jun 28, 2019
@mattab mattab added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Jun 28, 2019
@bizpp4253
Copy link
Author

bizpp4253 commented Jun 28, 2019

No plugin. I am using an externally implemented 3rd party SSO.
I check the availability of a valid cookie from this SSO service . If not available, redirect to SSO and upon return from SSO , hydrate a fresh cookie.
After successful return from SSO, i login to Matomo using the Logme url as share earlier.

@bizpp4253
Copy link
Author

Any news on this thread ? :(

@tsteur
Copy link
Member

tsteur commented Jul 6, 2019

I can't reproduce the issue. Any chance you send us URL and login to your Matomo to hello at matomo.org? We can maybe have a look.

@tsteur tsteur removed the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Jul 6, 2019
@mattab
Copy link
Member

mattab commented Nov 8, 2019

Thanks for contributing to this issue. As it has been a few months since the last activity and we believe this is likely not an issue anymore, we will now close this. If that's not the case, please do feel free to either reopen this issue or open a new one. We will gladly take a look again!

@mattab mattab closed this as completed Nov 8, 2019
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

3 participants