Connecting to the 1.8 API

Dan,

I thought that would move use a long. I am getting a 400 error when trying obtain the token.

Just to clarify (swagger.json is still a little vague on the oauth connections), these variables are not needed during the oAuth process:

?service=oauth&method=request_token
?p=oauth&q=authorize
?service=oauth&method=access_token

Here is the log:

logId,runNo,logDate,channel,page,function,message,display.display,type
40,50696d7,"2015-09-16 15:27:02",AUTH,/access_token,POST,"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "grant_type" parameter.",,DEBUG
41,50696d7,"2015-09-16 15:27:02",AUTH,/access_token,POST,"Storage rollback.",,DEBUG
42,6a7d4c7,"2015-09-16 15:27:07",WEB,/log/view,GET,"Loading 1. All Objects = 0",,DEBUG
43,7994450,"2015-09-16 15:27:09",WEB,/log,GET,"Loading 1. All Objects = 0",,DEBUG
44,147223c,"2015-09-16 15:27:35",WEB,/fault/view,GET,"Loading 1. All Objects = 0",,DEBUG
45,5ccca9e,"2015-09-16 15:27:39",WEB,/fault/collect,GET,"Loading 1. All Objects = 0",,DEBUG

The error happens when process this part of our code:

$token = OAuthRequester::requestRequestToken(CONSUMER_KEY, $user_id);

CONSUMER_KEY is defined just prior to this, $user_id is set to 1.

It does need a little additional documentation I think - basically the parameters expected are the standard oAuth parameters which you’d usually expected to be provided by the library you are using.

The process is as follows:

  • Call /api/authorize (this was services.php?service=oauth&method=request_token)
  • Get redirected to /application/authorize (this was index.php?p=oauth&q=authorize)
  • Login and grant access, get redirected back to your application
  • Call /api/authorize/access_token (this was services.php?service=oauth&method=access_token)

It looks like you have reached the last step without calling the prior ones - how have you configured your client?

$consumer_key = '<<your key>>';
$user_id = 1;
 
$store = OAuthStore::instance("MySQL", $store_options);
 
$server = null; 
try {
	$server = $store->getServer($consumer_key, $user_id);
} catch (OAuthException2 $e) {
    $server = array(
        'consumer_key' => $consumer_key,
        'consumer_secret' => '<<your secret>>',
        'server_uri' => 'https://<<your_url>>/api',
        'signature_methods' => array('HMAC-SHA1'),
        'request_token_uri' => 'https://<<your_url>>/api/authorize',
        'authorize_uri' => 'https://<<your_url>>/application/authorize', 
        'access_token_uri' => 'https://<<your_url>>/api/authorize/access_token'
    );
 
    $store->updateServer($server, $user_id);
}

There are some great libraries for doing php-client oauth2 now - for example: https://github.com/thephpleague/oauth2-client.

I think it would be worth writing a provider for oauth2-client so that it is a simple matter of initialising a new \xibosignage\OAuth2\Client\Provider\XiboCms object.

Dan,

Thank you for your reply and help tracking down my problem.

I removed “/access_token” from the end of the request_token_uri" line and now get a 301 error. Which would probably explain why it looked like the first couple of steps were missed. So now it looks like the system knows it is suppose to get redirected but it is not actually redirecting.

Current error:

Uncaught exception 'OAuthException2' with message 'Unexpected result from the server "https://localhost/xibo18alpha/web/api/authorize" (301) while requesting a request token' 

I see nothing in the CMS log.

Note: This part should probably be moved to a new topic as it is now not dealing with swagger.json.

Thanks for this link. I seem to be having more success with oauth2, but I keep running into errors like this error:

Catchable fatal error: Argument 1 passed to League\OAuth2\Client\Provider\AbstractProvider::prepareAccessTokenResponse() must be of the type array, string given, called in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-client-master\src\Provider\AbstractProvider.php on line 537 and defined in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-client-master\src\Provider\AbstractProvider.php on line 708

Which leads to this line of code:

$accessToken = $provider->getAccessToken('authorization_code', [
           'code' => $_GET['code']
        ]);

So I revert to my previous code, and spotted a few things after working with the oauth2 library. I can almost complete gaining access via the api. I get this messages after clicking on Approve:
Unexpected Error, please contact support.

CMS Log shows:

Argument 1 passed to League\OAuth2\Server\Entity\SessionEntity::associateClient() must be an instance of League\OAuth2\Server\Entity\ClientEntity, null given, called in C:\wamp\www\xibo18alpha\vendor\league\oauth2-server\src\Grant\AuthCodeGrant.php on line 150 and defined#0 C:\wamp\www\xibo18alpha\vendor\league\oauth2-server\src\Entity\SessionEntity.php(225): Slim\Slim::handleErrors(4096, 'Argument 1 pass...', 'C:\\wamp\\www\\xib...', 225, Array) #1 C:\wamp\www\xibo18alpha\vendor\league\oauth2-server\src\Grant\AuthCodeGrant.php(150): League\OAuth2\Server\Entity\SessionEntity->associateClient(NULL) #2 C:\wamp\www\xibo18alpha\lib\Controller\Applications.php(100): League\OAuth2\Server\Grant\AuthCodeGrant->newAuthorizeRequest('user', 1, false) #3 [internal function]: Xibo\Controller\Applications->authorize() #4 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Route.php(173): call_user_func_array(Array, Array) #5 [internal function]: Slim\Route->Slim\{closure}() #6 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array) #7 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch() #8 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call() #9 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call() #10 C:\wamp\www\xibo18alpha\lib\Middleware\Actions.php(78): Slim\Middleware\MethodOverride->call() #11 C:\wamp\www\xibo18alpha\lib\Middleware\WebAuthentication.php(118): Xibo\Middleware\Actions->call() #12 C:\wamp\www\xibo18alpha\lib\Middleware\CsrfGuard.php(64): Xibo\Middleware\WebAuthentication->call() #13 C:\wamp\www\xibo18alpha\lib\Middleware\Theme.php(33): Xibo\Middleware\CsrfGuard->call() #14 C:\wamp\www\xibo18alpha\lib\Middleware\State.php(91): Xibo\Middleware\Theme->call() #15 C:\wamp\www\xibo18alpha\lib\Middleware\Storage.php(39): Xibo\Middleware\State->call() #16 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1302): Xibo\Middleware\Storage->call() #17 C:\wamp\www\xibo18alpha\web\index.php(120): Slim\Slim->run() #18 {main}

The false bit is almost certainly the problem - that should be the auth params that were generated with your first request.

When you look a the authorise form, do you see your application name, etc listed?

Is your initial request coming from the same browser as your authorise action?

OK, so i’ve done a few things - namely written a Provider and Example for the oauth2-client library. During the course of that activity I discovered 2 bugs in the Authorization and Resource server (https://github.com/xibosignage/xibo-cms/pull/109)

These are fixed in the latest develop code.

You can find the provider and example here: https://github.com/xibosignage/oauth2-xibo-cms

Yes and Yes.

With the fixes of your two post, this one and the layout designer media adding, I will start fresh again with 1.8 alpha. Thank you for your quick and informative replies.

You’re welcome - i’ve run through the provider “end to end” and managed to get authorised correctly, so that is encouraging :smiley:

There are a few more security bits in place with this API, for example you must provide the correct redirect URI, you must make the first request and the authorise from the same session, etc.

1 Like

I think we are getting closer on the API authorization. The problem I am currently up against is that Xibo when first trying to login (API authorization or not) does not login properly the first time. This is what happens if I have logged out and have cleared the browser’s cache. (Does not happen everytime for some reason)

  1. Attempt to login on Xibo login screen, when I hit login, I get “The webpage cannot be found”. (Looks like it reverts to domain.com/application/authorize, instead of domain/pathtocms/application/authorize)
  2. I refresh the page and get the login screen again.
  3. I log in again and the login works. - This prevents the authorization for the API because it is apparently not the same session anymore, as I get this:

Authorisation Parameters missing from session.

Also note the misspelling, at least for en_US, and xibo oauth uses Guzzel 3 which is deprecated.

Update: Using oauth2-xibo-cms-master, your guide/example with a download of the latest version of 1.8 alpha code, a few tweaks to Base.php and we have now have a smaller code footprint and soon to be a successful connection via the API. :stuck_out_tongue_winking_eye: :smiley:

Ok… little early on the celebration. Still, I will take the pre-party.

Login problem with the 3 steps above still is a problem, but now at least it lets the process complete.

Update2: Ok one small little problem left. On return of the “code” we also get this error:

InvalidArgumentException: Required option not passed: access_token Array ( )

Update 3: Had a minor capitalization mistake that we fixed. After that we got an error about using a self-signed certificate. Installed a valid cert and now we get:

Guzzle\Http\Exception\CurlException: [curl] 60: SSL certificate problem: unable to get local issuer certificate [url] https://DOMAIN.com/xibo18alpha/web/api/authorize/access_token in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php on line 359

Tried to follow this, but still no dice.

Update 4: Installed correct Intermediate Certs and now back to:

InvalidArgumentException: Required option not passed: access_token Array ( ) in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\league\oauth2-client\src\Token\AccessToken.php on line 38

PHP Log show this:

[19-Sep-2015 22:35:27 America/Los_Angeles] PHP Stack trace:

[19-Sep-2015 22:35:27 America/Los_Angeles] PHP   1. {main}() C:\wamp\www\xibo_interface_c\index.php:0

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP Warning:  Uncaught exception 'ErrorException' with message 'require(C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src/Lang/.php): failed to open stream: No such file or directory' in C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src\Date.php:374
Stack trace:
#0 C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src\Date.php(374): Slim\Slim::handleErrors(2, 'require(C:\\wamp...', 'C:\\wamp\\www\\xib...', 374, Array)
#1 C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src\Date.php(374): Jenssegers\Date\Date::setLocale()
#2 C:\wamp\www\xibo18alpha\lib\Middleware\State.php(106): Jenssegers\Date\Date::setLocale(false)
#3 C:\wamp\www\xibo18alpha\lib\Middleware\State.php(43): Xibo\Middleware\State::setState(Object(Slim\Slim))
#4 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1302): Xibo\Middleware\State->call()
#5 C:\wamp\www\xibo18alpha\web\api\authorize\index.php(120): Slim\Slim->run()
#6 {main}
  thrown in C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src\Date.php on line 374

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP Stack trace:

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP   1. {main}() C:\wamp\www\xibo18alpha\web\api\authorize\index.php:0

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP   2. Slim\Slim->run() C:\wamp\www\xibo18alpha\web\api\authorize\index.php:120

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP   3. Xibo\Middleware\State->call() C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php:1302

[19-Sep-2015 22:35:32 America/Los_Angeles] PHP   4. Xibo\Middleware\State::setState() C:\wamp\www\xibo18alpha\lib\Middleware\State.php:43

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP   5. Jenssegers\Date\Date::setLocale() C:\wamp\www\xibo18alpha\lib\Middleware\State.php:106

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP Fatal error:  Jenssegers\Date\Date::setLocale(): Failed opening required 'C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src/Lang/.php' (include_path='.;C:\php\pear') in C:\wamp\www\xibo18alpha\vendor\jenssegers\date\src\Date.php on line 374

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP Stack trace:

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP   1. {main}() C:\wamp\www\xibo18alpha\web\api\authorize\index.php:0

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP   2. Slim\Slim->run() C:\wamp\www\xibo18alpha\web\api\authorize\index.php:120

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP   3. Xibo\Middleware\State->call() C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php:1302

[19-Sep-2015 22:35:33 America/Los_Angeles] PHP   4. Xibo\Middleware\State::setState() C:\wamp\www\xibo18alpha\lib\Middleware\State.php:43

[19-Sep-2015 22:35:34 America/Los_Angeles] PHP   5. Jenssegers\Date\Date::setLocale() C:\wamp\www\xibo18alpha\lib\Middleware\State.php:106

[19-Sep-2015 22:35:34 America/Los_Angeles] PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Required option not passed: access_token

Array
(
)
' in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\league\oauth2-client\src\Token\AccessToken.php:38
Stack trace:
#0 C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\league\oauth2-client\src\Grant\AuthorizationCode.php(25): League\OAuth2\Client\Token\AccessToken->__construct(Array)
#1 C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(215): League\OAuth2\Client\Grant\AuthorizationCode->handleResponse(Array)
#2 C:\wamp\www\xibo_interface_c\index.php(217): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken('authorization_c...', Array)
#3 {main}
  thrown in C:\wamp\www\xibo_interface_c\3rdParty\oauth2-xibo-cms-master\vendor\league\oauth2-client\src\Token\AccessToken.php on line 38

Traced to Date.php:

   public static function setLocale($locale)
    {
        // Use RFC 5646 for filenames.
        $resourcePath = __DIR__ . '/Lang/' . str_replace('_', '-', $locale) . '.php';
        // Symfony locale format.
        $locale = str_replace('-', '_', $locale);

        static::getTranslator()->setLocale($locale);

        static::getTranslator()->addResource('array', require $resourcePath, $locale);
    }

$locale does not seem to be being populated.

The translation wouldn’t have been done yet as its a new string - and Guzzle 3 is a dependency of the underlying league/oauth2-client library, so I would assume that is OK.

For the form buttons, or something else?

Can you have CMS debugging running when you make that request? Hopefully it will provide some additional information which will help us understand why $locale isn’t being populated.

I think this is a herring rouge in that the prior response (the one that returns the access_token) isn’t working. My example is intentionally light on error reporting, which you might want to add in for your actual API.

For the Form buttons and drop down menus.

logId,runNo,logDate,channel,page,function,message,display.display,type
1,401cc72,"2015-09-20 09:18:07",WEB,/application/authorize,GET,"Loading 1. All Objects = 0",,DEBUG
2,0717bf2,"2015-09-20 09:18:42",WEB,/application/authorize,POST,"Loading 1. All Objects = 0",,DEBUG
3,0717bf2,"2015-09-20 09:18:42",WEB,/application/authorize,POST,"Redirect URL is https://DOMAIN.com/xibo_interface_c/index.php?code=givRstraVtyJhFrz5ufxVGAhhgFP3zGONcQ4XA4f&amp;state=a378269234b222ab0713cca046005185",,DEBUG
4,9eb1608,"2015-09-20 09:18:43",AUTH,,POST,"Resolved language en_US not available.",,INFO
5,6a6d32d,"2015-09-20 09:19:04",WEB,/log/view,GET,"Loading 1. All Objects = 0",,DEBUG
6,8485f35,"2015-09-20 09:19:06",WEB,/log,GET,"Loading 1. All Objects = 0",,DEBUG
7,894c1cf,"2015-09-20 09:19:15",WEB,/fault/view,GET,"Loading 1. All Objects = 0",,DEBUG
8,0a79db9,"2015-09-20 09:19:19",WEB,/fault/collect,GET,"Loading 1. All Objects = 0",,DEBUG

This is the problem - your default language is set to en_US but that file cannot be found.

I’d suggest we need a little more information as to why it cannot be found - can you edit L89 of lib\Helper\Translate.php and make it read:

Log::Info('Resolved language [%s] not available, checked in %s and found %s.', $default, $localeDir, json_encode($supportedLanguages));

I have also changed the date initialisation to read:

if (Translate::GetLocale(2) != '')
    Date::setLocale(Translate::GetLocale(2));

in lib\Middleware\State.php L106 - w’d still expect an INFO log from the above change.

I am thinking this should actually be:

if (Translate::GetLocale(2) != '')  {
    Date::setLocale(Translate::GetLocale(2));
}

I made the changes and then the results I got were unexpected. I am not sure what happened but here is the log. I have reverted the changes for now.

logId,runNo,logDate,channel,page,function,message,display.display,type
1,4da438a,"2015-09-21 09:38:51",AUTH,/,GET,"Client authentication failed.",,DEBUG
2,4da438a,"2015-09-21 09:38:51",AUTH,/,GET,"Storage rollback.",,DEBUG
3,aaa7729,"2015-09-21 09:39:03",WEB,/,GET,"Request to redirect to login. Ajax = 0",,DEBUG
4,6038931,"2015-09-21 09:39:07",WEB,/login,POST,"Login with username xibo_admin",,DEBUG
5,6038931,"2015-09-21 09:39:07",WEB,/login,POST,"Password checked out OK",,DEBUG
6,6038931,"2015-09-21 09:39:07",WEB,/login,POST,"xibo_admin user logged in.",,INFO
7,6038931,"2015-09-21 09:39:07",WEB,/login,POST,"Redirect to /",,DEBUG
8,5a60d9b,"2015-09-21 09:39:10",AUTH,/,GET,"Client authentication failed.",,DEBUG
9,5a60d9b,"2015-09-21 09:39:10",AUTH,/,GET,"Storage rollback.",,DEBUG
10,8f0b797,"2015-09-21 09:39:18",AUTH,/,GET,"Client authentication failed.",,DEBUG

UPDATE: I really should drink more coffee before programming. Problem with trying to get more in the logs and failing was on my side.

Here is the log:

logId,runNo,logDate,channel,page,function,message,display.display,type
1,0bfc654,"2015-09-21 09:57:06",WEB,/application/authorize,GET,"Loading 1. All Objects = 0",,DEBUG
2,6ba3307,"2015-09-21 09:57:11",WEB,/application/authorize,POST,"Loading 1. All Objects = 0",,DEBUG
3,6ba3307,"2015-09-21 09:57:11",WEB,/application/authorize,POST,"Redirect URL is https://DOMAIN.com/xibo_interface_c/index.php?code=978sHmDM4edEC8dmQUnKsRUZx8abuXo6jhMEof0G&amp;state=e500b404d4b725d5fb78e79e74c1bc6e",,DEBUG
4,0495154,"2015-09-21 09:57:11",AUTH,,POST,"Resolved language [en_US] not available, checked in C:\wamp\www\xibo18alpha/locale and found [&quot;.&quot;,&quot;..&quot;,&quot;README.md&quot;,&quot;af.mo&quot;,&quot;ar.mo&quot;,&quot;ca.mo&quot;,&quot;cs.mo&quot;,&quot;da.mo&quot;,&quot;dbtranslate.php&quot;,&quot;de.mo&quot;,&quot;default.mo&quot;,&quot;default.pot&quot;,&quot;el.mo&quot;,&quot;en_GB.mo&quot;,&quot;es.mo&quot;,&quot;et.mo&quot;,&quot;fa.mo&quot;,&quot;fi.mo&quot;,&quot;fr.mo&quot;,&quot;he.mo&quot;,&quot;hi.mo&quot;,&quot;hr.mo&quot;,&quot;hu.mo&quot;,&quot;id.mo&quot;,&quot;it.mo&quot;,&quot;ja.mo&quot;,&quot;ko.mo&quot;,&quot;lb.mo&quot;,&quot;nb.mo&quot;,&quot;nl.mo&quot;,&quot;nl_NL.mo&quot;,&quot;pl.mo&quot;,&quot;pt.mo&quot;,&quot;pt_BR.mo&quot;,&quot;ro.mo&quot;,&quot;ru.mo&quot;,&quot;sl.mo&quot;,&quot;sv.mo&quot;,&quot;th.mo&quot;,&quot;tr.mo&quot;,&quot;vi.mo&quot;,&quot;zh_CN.mo&quot;,&quot;zh_TW.mo&quot;].",,INFO
5,0495154,"2015-09-21 09:57:11",AUTH,/access_token,POST,"Request for access token",,DEBUG
6,0495154,"2015-09-21 09:57:11",AUTH,/access_token,POST,"Issued token: {&quot;access_token&quot;:&quot;LSR6ysmolnx3N9vx4MGYLqfFXUrytgwmrwfasIxm&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;expires_in&quot;:3600,&quot;refresh_token&quot;:&quot;i6jZXCJOJBEUfupQeD3ed75efKKmyvCdCQfwWPqD&quot;}",,DEBUG
7,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Sorry the form has expired. Please refresh.#0 [internal function]: Xibo\Middleware\CsrfGuard-&gt;check()
#1 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1210): call_user_func_array(Array, Array)
#2 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1349): Slim\Slim-&gt;applyHook('slim.before')
#3 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim-&gt;call()
#4 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash-&gt;call()
#5 C:\wamp\www\xibo18alpha\lib\Middleware\Actions.php(78): Slim\Middleware\MethodOverride-&gt;call()
#6 C:\wamp\www\xibo18alpha\lib\Middleware\WebAuthentication.php(118): Xibo\Middleware\Actions-&gt;call()
#7 C:\wamp\www\xibo18alpha\lib\Middleware\CsrfGuard.php(64): Xibo\Middleware\WebAuthentication-&gt;call()
#8 C:\wamp\www\xibo18alpha\lib\Middleware\Theme.php(33): Xibo\Middleware\CsrfGuard-&gt;call()
#9 C:\wamp\www\xibo18alpha\lib\Middleware\State.php(91): Xibo\Middleware\Theme-&gt;call()
#10 C:\wamp\www\xibo18alpha\lib\Middleware\Storage.php(39): Xibo\Middleware\State-&gt;call()
#11 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1302): Xibo\Middleware\Storage-&gt;call()
#12 C:\wamp\www\xibo18alpha\web\index.php(120): Slim\Slim-&gt;run()
#13 {main}",,DEBUG
8,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Sorry the form has expired. Please refresh. Exception Type: Xibo\Exception\TokenExpiredException",,ERROR
9,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: schedule",,ERROR
10,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: campaign",,ERROR
11,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: layout",,ERROR
12,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: template",,ERROR
13,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: resolution",,ERROR
14,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: library",,ERROR
15,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: dataset",,ERROR
16,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: display",,ERROR
17,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: displaygroup",,ERROR
18,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: stats",,ERROR
19,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: displayprofile",,ERROR
20,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: user",,ERROR
21,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: usergroup",,ERROR
22,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: admin",,ERROR
23,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: application",,ERROR
24,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: module",,ERROR
25,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: transition",,ERROR
26,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: log",,ERROR
27,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: sessions",,ERROR
28,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: auditlog",,ERROR
29,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: fault",,ERROR
30,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Request for unknown route: help",,ERROR
31,cb3809a,"2015-09-21 09:57:25",WEB,,POST,"Storage rollback.",,DEBUG
32,9872a54,"2015-09-21 09:57:31",WEB,/login,POST,"Login with username xibo_admin",,DEBUG
33,9872a54,"2015-09-21 09:57:31",WEB,/login,POST,"Password checked out OK",,DEBUG
34,9872a54,"2015-09-21 09:57:31",WEB,/login,POST,"xibo_admin user logged in.",,INFO
35,9872a54,"2015-09-21 09:57:31",WEB,/login,POST,"Redirect to /xibo18alpha/web/",,DEBUG
36,dda2f42,"2015-09-21 09:57:32",WEB,/,GET,"Loading 1. All Objects = 0",,DEBUG
37,dda2f42,"2015-09-21 09:57:32",WEB,/,GET,"Showing the homepage: 29",,DEBUG
38,384b81c,"2015-09-21 09:57:32",WEB,/dashboard/status,GET,"Loading 1. All Objects = 0",,DEBUG
39,3f6117f,"2015-09-21 09:57:38",WEB,/fault/view,GET,"Loading 1. All Objects = 0",,DEBUG
40,da70885,"2015-09-21 09:57:42",WEB,/fault/collect,GET,"Loading 1. All Objects = 0",,DEBUG

Looks like its right? you don’t have an en_US locale and yet that is what you have set in your default language in CMS settings

If you change that to en_GB it should work…

Odd though, I did think there was an en_US translation

I set it to en_US, as our production server uses this setting on 1.7.3. I am pretty sure it was set to this to fix some other problem in a previous version of the CMS. But now I can’t remember why.

I looked in the locale folder of our production server and it also does not have the file.

I thought it was in the code that if the locale was not found that it should revert to the default of en_GB. Am I wrong on this?

UPDATE This was to correct a localization problem. So if I am not mistaken, the en_US is also used bu Xibo to send/set the local for apache??

If the locale requested/detected isn’t present it reverts to the one in settings - so the one in settings should exist. It actually reverts to “no translation”, so I think its OK to leave it as you have it.

There should be an en_US translation as some phrases will be different - lots of “z’s” all over the place :smiley: i’m not sure why there isn’t, i’ll check

Curious if you have had time to look at this. I know you are very busy. :smiley:

Well, sort of :smile:

Essentially there isn’t a file because there isn’t a translation: https://translations.launchpad.net/xibo/github/+pots/default/en_US/+translate

Once we get a contributed translation to one of the strings the file will be included in the next version.

Thank you for the quick reply and update.