Using email + password flow and social networks #1691
-
Hi! In our project we try to implement the following architecture:
And we faced some difficulties during implementation that we cannot resolve.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I could not find anything directly related to this in the docs either. It does say: I thought this means that all FB accounts that are accessible via OAuth require an email. But apparently, you can use OAuth without having an email added to your profile, is that correct? The identity would look like How does the social login identity look like? There is probably multiple ways to solve this, you could include a boolean trait isAdmin on your identity schema that you can read with /whoami. Or you can use multiple identity schemas and employ a switch as outlined in the docs:
// This is an example program that can deal with all three types of identities
session, err := ory.SessionFromRequest(r)
// some error handling
switch (session.Identity.SchemaID) {
case "customer":
// ...
case "employee":
// ...
case "default":
fallthrough
default:
// ...
}
|
Beta Was this translation helpful? Give feedback.
I could not find anything directly related to this in the docs either. It does say:
// It is assumed that Facebook requires an email to be verified before accessible via Oauth (because they don't provide an email_verified field).
I thought this means that all FB accounts that are accessible via OAuth require an email. But apparently, you can use OAuth without having an email added to your profile, is that correct?
Could you use phone_number in claims if they don't have an email set?
PhoneNumber string
json:"phone_number,omitempty"``The identity would look like
{ "sub": "some-identity-id-4hA8gk", "phone_number": "123456576567", "website": "https://www.ory.sh"}
instead of
{ "sub": "som…