atinux / nuxt-auth-utils

Add Authentication to Nuxt applications with secured & sealed cookies sessions.
MIT License
974 stars 91 forks source link

make requestAccessToken and other utils importable #194

Open acidjazz opened 1 month ago

acidjazz commented 1 month ago

I've been adding my own oauth providers apple , would be helpful to be able to re-use this and other utils.

atinux commented 1 month ago

Why not opening a PR to add support for Apple login?

This will also resolve #187

acidjazz commented 1 month ago

Why not opening a PR to add support for Apple login?

This will also resolve #187

I can look into it but apple does not follow oauth2 standards which a lot of people are not happy about. Specifically you only get the user information the very 1st time they login with apple, after that you just get their email via the token payload

sans1994 commented 1 month ago

Why not opening a PR to add support for Apple login? This will also resolve #187

I can look into it but apple does not follow oauth2 standards which a lot of people are not happy about. Specifically you only get the user information the very 1st time they login with apple, after that you just get their email via the token payload

@acidjazz In fact, in certain cases, this is entirely sufficient. For example, the project I am currently working on receives data from providers only during the initial identification phase. That is, when the user logs in for the first time, I send data from the provider to the backend for identification in our system (our API returns an existing user if the email matches, or a new one is created).

So, we do not request data from the provider again, and it is only needed for identification (during login), while all further interaction happens with our backend.

acidjazz commented 1 month ago

Why not opening a PR to add support for Apple login? This will also resolve #187

I can look into it but apple does not follow oauth2 standards which a lot of people are not happy about. Specifically you only get the user information the very 1st time they login with apple, after that you just get their email via the token payload

@acidjazz In fact, in certain cases, this is entirely sufficient. For example, the project I am currently working on receives data from providers only during the initial identification phase. That is, when the user logs in for the first time, I send data from the provider to the backend for identification in our system (our API returns an existing user if the email matches, or a new one is created).

So, we do not request data from the provider again, and it is only needed for identification (during login), while all further interaction happens with our backend.

What about cases where the data from that provider has changed? say name details/avatar/etc ?

sans1994 commented 1 month ago

What about cases where the data from that provider has changed? say name details/avatar/etc ?

@acidjazz @atinux I understand the issue, but there's not much you can do, considering that Apple is unlikely to change its policy. Therefore, in my opinion, cases where a developer is ready to store user data in their own database during initial identification should be supported, as that’s all that can be done in this case (clearly documenting it). As I mentioned, this functionality is fully sufficient for my case, as I only identify the user in the system by their email and then retrieve the necessary data from my own server.

It would be great if nuxt-auth-utils could support this provider’s functionality at least in this way (since due to the limitations, there’s no better approach available).

acidjazz commented 1 month ago

What about cases where the data from that provider has changed? say name details/avatar/etc ?

@acidjazz @atinux I understand the issue, but there's not much you can do, considering that Apple is unlikely to change its policy. Therefore, in my opinion, cases where a developer is ready to store user data in their own database during initial identification should be supported, as that’s all that can be done in this case (clearly documenting it). As I mentioned, this functionality is fully sufficient for my case, as I only identify the user in the system by their email and then retrieve the necessary data from my own server.

It would be great if nuxt-auth-utils could support this provider’s functionality at least in this way (since due to the limitations, there’s no better approach available).

Agreed, thats what I've had to do.

I will start a PR soon and link to this issue, glad to see other people have had to go down this road, input will be greatly appreciated!

sans1994 commented 2 weeks ago

What about cases where the data from that provider has changed? say name details/avatar/etc ?

@acidjazz @atinux I understand the issue, but there's not much you can do, considering that Apple is unlikely to change its policy. Therefore, in my opinion, cases where a developer is ready to store user data in their own database during initial identification should be supported, as that’s all that can be done in this case (clearly documenting it). As I mentioned, this functionality is fully sufficient for my case, as I only identify the user in the system by their email and then retrieve the necessary data from my own server. It would be great if nuxt-auth-utils could support this provider’s functionality at least in this way (since due to the limitations, there’s no better approach available).

Agreed, thats what I've had to do.

I will start a PR soon and link to this issue, glad to see other people have had to go down this road, input will be greatly appreciated!

Greetings! Have you had a chance to find time to integrate this provider into the library and can i expect it to be available soon?