Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.
PLEASE READ - Webmaster Support Forum
This forum will be retired in the near future. Please direct all queries to our dedicated GitHub support page https://github.com/vatsimnetwork/developer-info/discussions 
Here you can find documentation on our services and we are continuing to migrate pertinent information into the Wiki pages https://github.com/vatsimnetwork/developer-info/wiki

VATSIM SSO with Laravel 5.6 Error


Lakehal Abd Ellatif
 Share

Recommended Posts

Lakehal Abd Ellatif
Posted
Posted

I am working on VATSIM SSO for VATSAF (Vatsim South African Division Website) with Laravel 5.6

I have installed and configured VATSIM SSO vatsim/sso-laravel 3* as any other Laravel packages

 

I am using harden demo API to implement SSO before asking for VATSIM credentials However I am getting this error

 

Trying to get property 'request' of non-object

Error in line 234 in SSO.php file:
if ( $sso->request->result === 'success' )

 

My config/vatsim-sso.php file looks like this

 

<?php

return [

   /*
    * The location of the VATSIM OAuth interface
    */
   'base'            => 'http://sso.hardern.net/server/auth/login/',

   /*
    * The consumer key for your organisation (provided by VATSIM)
    */
   'key'             => "SSO_DEMO_VACC",

   /*
   * The secret key for your organisation (provided by VATSIM)
   * Do not give this to anyone else or display it to your users. It must be kept server-side
   */
   'secret'          => "04i_~ruVUE.1-do1--sc",

   /*
    * The URL users will be redirected to after they log in, this should
    * be on the same server as the request
    */
   'return'          => 'vatsaf.io:8023', //not sensitive

   /*
    * The signing method you are using to encrypt your request signature.
    * Different options must be enabled on your account at VATSIM.
    * Options: RSA / HMAC
    */
   'method'          => 'RSA',

   /*
    * Your RSA **PRIVATE** key
    * If you are not using RSA, this value can be anything (or not set)
    */
   'cert'            => <<<EOT
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEA2S5RckDw7SnEoZDmjaQHAQGajVlb7iwKIAX6nXbZBO7Uo3pN
ItjmAbfkMqKBgWDVowM3UjbKivZNWGzkmxirArpbw9q7JhcX2LW6RfXx+5zn2+zW
m58nQtn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coQWx9NpMPU9Uzsey
42pdY6zBwjZuTtRUnsKId/JZAoGBALzXVXyfF85Ec76+mDicaodWZWwCgy+mSXCj
KF3BbkvPojMR1Jd9o20gwJQVK3ToPDiud30ZJlZH++LZoDPhLe6IJWvlXq6y3lsQ
ONQxKNY7Mm9wBqtzwTfYPsLnzO4N2z4Sgn2nx6bHlbGKQO09SFyCqbsOlu8z+v7i
VlU8uJ8JAoGBAOmzlKBcEjJdlD0ZxkgMxp+YqpKkC+ojzf4tORn6jo2d/aKUOIAR
bfRCMTmDmqyVoUH/SYgQWzD36zAy8HyHEz0U1k6+QMzWPbsEGQSQrk0DgnlOBPWo
O0gQ0RDS3gD8C5XHvy5vryYjUOB10rUn9A2xLQw4sqKv2suHvIhc0Eit
-----END RSA PRIVATE KEY-----
EOT
   ,

   /*
    * Set to true to allow suspended users to sign in
    */
   'allow_suspended' => false,

   /*
    * Set to true to allow inactive users to sign in
    */
   'allow_inactive'  => false,

];

1319182

Abd Ellatif Lakehal

https://lotfio.net

955.png

Link to comment
Share on other sites

Daniel Hawton
Posted
Posted

It sounds like $sso isn't being initialized correctly before the $sso->request call, as PHP is telling you $sso isn't an object.

 

Is something like this before your line 234?

 

$sso = new SSO(config('sso.base'),
                            config('sso.key'),
                            config('sso.secret'),
                            config('sso.method'),
                            config('sso.cert'),
                            ['allow_suspended' => false, 'allow_inactive' => false]
                           );

Link to comment
Share on other sites

Lakehal Abd Ellatif
Posted
Posted

It is already configured on the OauthServiceProvider like so

 

return new SSO(
			array_get($config, 'base'), // base
			array_get($config, 'key'), // key
			array_get($config, 'secret'), // secret
			array_get($config, 'method'), // method
			array_get($config, 'cert') // certificate
		);

 

Here is the project repo if you want to take a quick look https://bitbucket.org/lotfio/vacc-panel/src/master/

1319182

Abd Ellatif Lakehal

https://lotfio.net

955.png

Link to comment
Share on other sites

Neil Farrington
Posted
Posted

This is the same issue as viewtopic.php?f=134&t=76302 - unfortunately, the demo SSO environment isn't available at the moment, which means when the JSON response is received, it doesn't have the correct format.

 

Currently, the demo environment simply returns "DB1001B", however when functioning properly, it should return something like:

{"request":{"result":"success","message":""},"user":{"id":"1104841","name_first":"Neil","name_last":"Farrington","rating":{"id":"4","short":"S3","long":"Student 3","GRP":"TMA Controller"},"pilot_rating":{"rating":"1","1":{"id":1,"short":"P1","long":"Online Pilot"}},"experience":"N","reg_date":"2009-04-08 21:51:39","country":{"code":"GB","name":"United Kingdom"},"region":{"code":"EUR","name":"Europe"},"division":{"code":"GBR","name":"United Kingdom"},"subdivision":{"code":null,"name":null}}}

Neil Farrington

VATSIM UK

Link to comment
Share on other sites

  • Board of Governors
Matthew Cianfarani
Posted
Posted

Regarding the Demo environment not working -

 

Gents, we know there's an issue. Unfortunately when transitioning technical roles and staff, things like this can happen. I am hoping we can get this resolved in the next few days.

 

For [Mod - Happy Thoughts]istance with implementing SSO in alternative methods, reach out to my team ([email protected]) and we can help.

 

Again, sorry for the stress and difficulty here. We are all heads-down working on a number of systems at the moment.

Matthew Cianfarani
Vice President , Technology 
VATSIM Board of Governors

Link to comment
Share on other sites

Lakehal Abd Ellatif
Posted
Posted

Thank you so much @Neil and @Matthew for you replays.

I will send an email to the provided address and see what will come out .

 

Best Regards,

1319182

Abd Ellatif Lakehal

https://lotfio.net

955.png

Link to comment
Share on other sites

  • 2 weeks later...
Aidan Stevens
Posted
Posted

All,

 

The demo SSO application is now back up and running. Thank you for your patience and a huge shoutout to Jamie Fox (VATGOV3) for fixing the MySQL daemon that was in a broken state due to an update.

 

Regards,

Link to comment
Share on other sites

 Share