solid-contrib / solid-auth-fetcher

A client library for authenticating with Solid
Other
2 stars 7 forks source link

WebId not retrieved correctly from ESS #17

Open NoelDeMartin opened 3 years ago

NoelDeMartin commented 3 years ago

I've been testing the library with different servers and it doesn't seem to work properly with ESS. When I try to log in using https://broker.pod.inrupt.com, the webId in the session is an alphanumeric string instead of a url.

To reproduce this, you can visit ramen.noeldemartin.com, click on "try using a different authentication method" and select "Log in using the community authentication library".

If you want to see how I am using this library, everything is encapsulated in this file: CommunityAuthenticator.ts

franzzua commented 3 years ago

I have found a workaround:

import decode from "jose/lib/jwt/decode";
// after get session
const tokens = JSON.parse(localStorage.getItem('solidAuthFetcherUser:global'));
const webId = decode(tokens.idToken).webid;