You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I developed an API that accesses resources on my pod. Access to resources requires the user to authenticate. The user authenticates to a web application that consumes the API. The application uses the solid auth client. After authentication, the API is called and the resources are read from the pod and returned to the user. However, it only works if access is granted to the general public (acl:agentClass foaf:Agent). When I grant access to an individual agent (acl:agent https://jleles.solid.community/profile/card#me), I receive the following message: "401 - Unauthenticated".
How to solve this? Thanks to anyone who can help!
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8"/>
<title>Example Application</title>
</head>
<body>
<p id="login">
You are not logged in.
<button>Log in</button>
</p>
<p id="logout">
You are logged in as <span id="user"></span>.
<button>Log out</button>
</p>
<script src="jquery.js"></script>
<script src="solid-auth-client.bundle.js"></script>
<script src="main.js"></script>
</body>
</html>
main.js
// Log the user in and out on click
const popupUri = 'popup.html';
$('#login button').click(() => solid.auth.popupLogin({ popupUri }));
$('#logout button').click(() => solid.auth.logout());
// Update components to match the user's login status
solid.auth.trackSession(session => {
const loggedIn = !!session;
$('#login').toggle(!loggedIn);
$('#logout').toggle(loggedIn);
if (loggedIn) {
$('#user').text(session.webId);
solid.auth.fetch(URL_API).then(response => { response.json().then(data => { console.log(data) })});
}
});
Hello, I developed an API that accesses resources on my pod. Access to resources requires the user to authenticate. The user authenticates to a web application that consumes the API. The application uses the solid auth client. After authentication, the API is called and the resources are read from the pod and returned to the user. However, it only works if access is granted to the general public (acl:agentClass foaf:Agent). When I grant access to an individual agent (acl:agent https://jleles.solid.community/profile/card#me), I receive the following message: "401 - Unauthenticated".
How to solve this? Thanks to anyone who can help!
.acl
index.html
main.js
console.log view
{timestamp: "2020-03-03T15:49:17.864+0000", status: 500, error: "Internal Server Error", message: "401 - Unauthenticated", path: "..."}
The text was updated successfully, but these errors were encountered: