Jump to content

[Preview] Vatsim Connect for Moodle


Sarantos Tsialtas
 Share

Recommended Posts

Hi guys, 

after a few days with the help from here this is my settings for moodle platform for OAuth2

image.thumb.png.147631430abd3edcb2e97084495341dd.png

image.thumb.png.34aae7f009dbb7bb588788e6da1adfbe.pngimage.png.4a9238d9387661bde62b2e492df7f67a.pngimage.thumb.png.22c9c0829ad36f2472d04d7f5c1bb1be.png

 

if you want to disable e-mail confirmation uppor 1rst login with Vatsim Connect run the commad bellow in your database: (you have to run it every time you change your settings on Vatsim Connect)

UPDATE mdl_oauth2_issuer SET requireconfirmation = 0  WHERE id = 1;

 

 

Edited by Sarantos Tsialtas
IP Wildcard and callback url
  • Like 1
Sarantos Tsialtas
vACC Director - ACCGR1
VSKgCsZ.png [email protected] 
ZWqL3H9.png Hellenic vACC
Link to comment
Share on other sites

  • Board of Governors

From what I can tell. service base URL needs to be https://auth.vatsim.net not your domain.

It might be worth looking at nested properties for the field mappings. Not sure how to do it as VATSIM doesn't have our own moodle service. There are several divisions that do so might be able to elaborate if they have achieved it.

 

Matt

 

Matt Bozwood-Davies
 Vice President Technical Development    
## [email protected]
## www.vatsim.net
## ##
Vatsim-color-tagline.png.7b888e6f6d0ad80d1d50939ae0a60bcc.png
Link to comment
Share on other sites

The Moodle documentation of OAuth2 user field mappings isn't great, I had to dig quite a while to figure this out for ourselves a while ago. Long story short, if the data is returned in a array that you need to nest, you use "-" to indicate this in the field mapping.

For instance "data-id" and "data-personal-name_first". This is probably your issue here, also as Matt said, service URL should be auth.vatsim.net.
You can find the data structure here: http://wiki.vatsim.net/connect.html under "Return Data Structure". I can't give you the exact copy of our settings as we've a quite different system for logging in.

Daniel Lange

Web Services Director
Vatsim Scandinavia

[email protected]

Link to comment
Share on other sites

18 hours ago, Daniel Lange said:

The Moodle documentation of OAuth2 user field mappings isn't great, I had to dig quite a while to figure this out for ourselves a while ago. Long story short, if the data is returned in a array that you need to nest, you use "-" to indicate this in the field mapping.

For instance "data-id" and "data-personal-name_first". This is probably your issue here, also as Matt said, service URL should be auth.vatsim.net.
You can find the data structure here: http://wiki.vatsim.net/connect.html under "Return Data Structure". I can't give you the exact copy of our settings as we've a quite different system for logging in.

thanks iu will try it and i will be back, also 

Quote
},
      "oauth":{
         "token_valid":"true"
      }

must be stored on database?

Sarantos Tsialtas
vACC Director - ACCGR1
VSKgCsZ.png [email protected] 
ZWqL3H9.png Hellenic vACC
Link to comment
Share on other sites

1 hour ago, Daniel Lange said:

No need, only store what you need for Moodle to function, which is pretty much username, name and email.

thanks i made it work...  now looking how to disable e-mail confirmation after login 

thanks for your time

 

Update: finally it worked... 1st post updated

 

Edited by Sarantos Tsialtas
Sarantos Tsialtas
vACC Director - ACCGR1
VSKgCsZ.png [email protected] 
ZWqL3H9.png Hellenic vACC
Link to comment
Share on other sites

  • Sarantos Tsialtas changed the title to [Preview] Vatsim Connect for Moodle
  • 3 weeks later...
15 hours ago, Sean Tan said:

Hi Sarantos, 

Thank you for your post regarding the VATSIM connect for Moodle. 

These are my current configuration for my oauth: https://prnt.sc/w5uk5uhttps://prnt.sc/w5ukfohttps://prnt.sc/w5ukks

However, I am seeing an error as stated: https://prnt.sc/w5uksp

 

Am I missing something ? 

Thanks 

 

Sean Tan 

 

Did you used an IP Wildcard (*)  at https://auth.vatsim.net  ?

Sarantos Tsialtas
vACC Director - ACCGR1
VSKgCsZ.png [email protected] 
ZWqL3H9.png Hellenic vACC
Link to comment
Share on other sites

In such a case, would I need to add in an ip address from my main host for auth.vatsim.net in order to ensure that it is working ? 

Second question: In regards to the oauth2callback.php, do u have the sample coding to be used if required or would the default script by moodle be suffice ? 

Thanks for your help 

 

Sean 

Edited by Sean Tan
Link to comment
Share on other sites

On 12/21/2020 at 9:38 AM, Sean Tan said:

In such a case, would I need to add in an ip address from my main host for auth.vatsim.net in order to ensure that it is working ? 

Second question: In regards to the oauth2callback.php, do u have the sample coding to be used if required or would the default script by moodle be suffice ? 

Thanks for your help 

 

Sean 

 

due to the scracture of our systems i am using my main IP adress from webserver and (*) for the rest....

 

the default script its ok

 

Merry Christmas

 

 

image.png.2adead2847345871f5c2914de85d0213.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...