phpvms icon indicating copy to clipboard operation
phpvms copied to clipboard

VATSIM OAuth

Open arthurpar06 opened this issue 5 months ago • 12 comments

This adds support for OAuth with VATSIM. I'll update the OAuth PR for the docs to include VATSIM support.

We only store the user's CID in the vatsim_id field, but it's possible to retrieve more data (such as their rank or division), though I'm not sure if that is what we want.

arthurpar06 avatar Jan 26 '24 14:01 arthurpar06

Also for VATSIM oAuth support, I think we can have something in register page, like Register with VATSIM account (same applies to IVAO support if someday we offer it) which will then pull user's details from VATSIM/IVAO (basics like name, email, network id, country -if possible-) and fill in our data, link accounts directly.

FatihKoz avatar Feb 04 '24 19:02 FatihKoz

We discussed having it on the registration page for discord, and it was the case during the initial implementation of OAuth that I did. However, Nabeel requested its removal to ensure that the required fields are properly filled in by users during registration.

We can add it back for vatsim and retrieve some fields, but not all. The question is how to properly retrive the others. Since we want to create an account, if the user hasn't chosen an airline, hub... we would need to assign random ones. It's possible, but it requires detailed consideration of how we want to achieve this.

arthurpar06 avatar Feb 05 '24 16:02 arthurpar06

Discord is different, i mean oAuth is same but logically discord membership is not equal to vatsim membership or ivao membership. They do require email activations, real names etc.

Anyway, maybe we can define some standards fo4 airline hub etc, o just get the data and parse to the live form, so people can fill the rest.

FatihKoz avatar Feb 05 '24 16:02 FatihKoz

Yeah I think this is a good idea, but it requries thought on how to fill in all the required fields that can't be filled with vatsim data.

arthurpar06 avatar Feb 05 '24 16:02 arthurpar06

We discussed having it on the registration page for discord, and it was the case during the initial implementation of OAuth that I did. However, Nabeel requested its removal to ensure that the required fields are properly filled in by users during registration.

We can add it back for vatsim and retrieve some fields, but not all. The question is how to properly retrive the others. Since we want to create an account, if the user hasn't chosen an airline, hub... we would need to assign random ones. It's possible, but it requires detailed consideration of how we want to achieve this.

I think that both Discord OAuth and VATSIM OAuth should populate on the registration field. Reason being is some communities may want/require real names to be used in registration. Discord usernames bypass that, and can create issues. VATSIM, not so much, because they can ship the real name.

Maybe we have it both ways, where a community can, via a checkbox, define if users can directly register via OAuth, or the form is prefilled from OAuth. That way the community has better control.

I believe Moodle LMS does the above.

BossOfGames avatar Feb 07 '24 01:02 BossOfGames

I completely agree with the idea of adding it to the registration, but my issue and question are how we handle the fields that the provider doesn't provide and that we need to create an account. While making displaying it optional or not is relatively simple, my problem is really how we decide on the airline, the hub, and the country for someone who has not chosen any.

The question also arises for custom fields. If there's a field that we are required to fill in upon registration, how do we fill it via vatsim or discord when vatsim or discord don't provide any data for that field?

arthurpar06 avatar Feb 07 '24 07:02 arthurpar06

I think you are mixing up recording a pilot directly and filling out the form with Vatsim fields.

So the answer to your main concern is simple, nothing will happen because people will be filling out the form fields manually :)

Only the data we get via Vatsim oauth will be pre-filled in relevant fields (like name, email, country, vatsim id etc) and those fields should be locked (readonly).

Applicant will fill out the rest (password, custom fields etc) accept the terms and click register.

Hope this clears out the confusion a little bit.

FatihKoz avatar Feb 07 '24 14:02 FatihKoz

Oh okay then I misunderstood... We should be able to do something like that.

However, do we really need something like that? I mean isn't it more work for something that will just avoid filling in two or three fields that could be filled in by the user registering in a few seconds?

arthurpar06 avatar Feb 07 '24 14:02 arthurpar06

Sure, that is another question :smile:

Honestly, I am happy with what we have at the moment, but making something more automated will also be nice.

I remember joining some VA's with just one click, they took all my data from IVAO and recorded me, then forwarded me to my profile to fill out custom fields.

It was nice, not mandatory of course but va knew that my account was active and all data was matching with IVAO records.

FatihKoz avatar Feb 07 '24 14:02 FatihKoz

I agree that the idea of one-click registration is great but I'm afraid we might be asking for too mnay fields to achieve it. I think we're able to automatically fill in name, email and maybe country (if specified). This means that the user still needs to manually enter their airline, home airport, timezone, password and all the custom fields...

arthurpar06 avatar Feb 07 '24 14:02 arthurpar06

I see no practical use of that timezone field, honestly in an airline environment, utc is the key and we are not posting out local times over and there.

Anyway, yeah it will be mostly manual inputs by the user, specially in a multi airline environment :)

FatihKoz avatar Feb 07 '24 15:02 FatihKoz

I see no practical use of that timezone field, honestly in an airline environment, utc is the key and we are not posting out local times over and there.

That's also another topic, although I agree 😄

Anyway, yeah it will be mostly manual inputs by the user, specially in a multi airline environment :)

Yes, that's why I'm not sure if there's a real gain.

arthurpar06 avatar Feb 07 '24 15:02 arthurpar06