Skip to content

Snapchat OAuth Provider #1998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ymiedviediev
Copy link

What kind of change does this PR introduce?

This introduces Snapchat OAuth2 provider for social login via Snapchat

What is the current behavior?

There is no possibility to login via Snapchat account

What is the new behavior?

Adding the functionality to login via snapchat as per official documentation:
Snap Login Kit Overview

@ymiedviediev ymiedviediev requested a review from a team as a code owner April 22, 2025 15:25
Copy link
Member

@kangmingtay kangmingtay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution @ymiedviediev!


data := &UserProvidedData{}

// Snapchat doesn't provide email by default, additional scopes needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email is currently a requirement for the oauth login to succeed - what are the additional scopes required and can we add them to the default set above?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapchat OAuth mechanism does not expose user emails. The workaround over here right now is to imitate the email format by adding @snapchat.id to the user's external id, which is considered to be unique and identify the user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ymiedviediev is snapchat.id a domain owned by snapchat? oauth users are allowed to initiate password recovery flows / email change which will result in an email link being sent to that email.

this would break those flows if a dummy value is used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the password recovery flow won't work for Snapchat OAuth integration, since email field is considered to be private information and is not part of the OAuth2 flow scopes.

@ymiedviediev ymiedviediev force-pushed the feature/snapchat-oauth branch from b836a13 to f782c9d Compare May 16, 2025 11:40
@ymiedviediev
Copy link
Author

@kangmingtay When you have time, please look into this PR again 🙏

@coveralls
Copy link

Pull Request Test Coverage Report for Build 15067614461

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 66 of 74 (89.19%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.08%) to 69.722%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/provider/snapchat.go 63 71 88.73%
Files with Coverage Reduction New Missed Lines %
internal/conf/saml.go 2 97.75%
Totals Coverage Status
Change from base Build 15049009181: 0.08%
Covered Lines: 11016
Relevant Lines: 15800

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants