KindeK
Kinde2y ago
4 replies
ryno1234.

picture / ext_provider claim inconsistent

I use the claim ext_provider to determine who facilitated the login (Google, Facebook or Kinde). At times this value is blank.

The problem is the picture claim can be in different formats depending upon where it comes from. For example, from Facebook it is an entire JSON structure. Previously, in Auth0, the equivalent of a picture claim was always a URL that we know we could use. Now, I have to determine if the ext_provider is Facebook, because if it is, I need to parse the picture claim and pull out specifically the URL and leave all the extra metadata provided.

The problem with this comes about sometimes when I login. On occasion there is no ext_provider value. I think this is when I've already authenticated previously on Kinde so when I attempt to login, my request just goes right through.

Ultimately, I would like to know what auth provider facilitated that login (google, facebook, etc.). That may or may not be reasonable depending upon how that's implemented in Kinde. That said, the only thing I really care about right now is have a reasonable way to retrieve the user's picture URL. The only way I see that being possible is if:

1) Kinde always provides an ext_provider value
2) Kinde parses the picture information from each integreated OAuth provided and normalizes this value so we can all use it in a consistent way
3) I have to explicitly look for {"data": {"url": "....", "width": 200, "height": 200, "is_silhouette": false}} in the picture claim to figure out if I need to parse it.

Right now I have some users that have broken profile images because their picture url is {"data": {"url": "....", "width": 200, "height": 200, "is_silhouette": false}}.

Thoughts?
Was this page helpful?