Hi! I’m working on a server app, written in Swift. So, am building up some networking request code of my own. I’m working from solid-spec/api-rest.md at master · solid/solid-spec · GitHub
In related work, I’m already able to get a refresh token, generate access tokens, and sign DPoP’s (see GitHub - crspybits/SolidAuthSwift: Swift-based authentication for a Solid Pod).
I’m trying to figure out what URL to use when making a request. For example, in solid-spec/api-rest.md at master · solid/solid-spec · GitHub they give an example for container creation:
POST / HTTP/1.1
Host: example.org
Content-Type: text/turtle
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Slug: data
Using URLSession and URLRequest to make the actual networking request in Swift, along with this, I pass additional headers:
authorization: "DPoP <ACCESSTOKEN>",
dpop: "<DPOPTOKEN>"
where <ACCESSTOKEN>
is the access token I’ve successfully obtained from the solid server, and <DPOPTOKEN>
is the signed DPoP token I’ve generated.
I have an account on inrupt.net (https://crspybits.inrupt.net/profile/card#me), but using that URL in place of the Host
above isn’t working.
E.g., I get back:
"<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Log in</title>\n <link rel=\"stylesheet\" href=\"/common/css/bootstrap.min.css\">\n <link rel=\"stylesheet\" href=\"/common/css/solid.css\">\n</head>\n<body>\n<div class=\"container\">\n <div class=\"page-header\">\n <div class=\"pull-right\">\n <button id=\"register\" type=\"button\" class=\"btn btn-primary\">Register</button>\n <button id=\"login\" type=\"button\" class=\"btn btn-success\">Log in</button>\n <button id=\"logout\" type=\"button\" class=\"hidden btn btn-danger\">Log out</button>\n </div>\n <h1>Log in to access this resource</h1>\n </div>\n\n <div class=\"alert alert-danger\">\n <p>\n The resource you are trying to access\n (<code>https://crspybits.inrupt.net/profile/card</code>)\n requires you to log in.\n </p>\n </div>\n\n</div>\n</div>\n<script src=\"/common/js/solid-auth-client.bundle.js\"></script>\n<script src=\"/common/js/auth-buttons.js\"></script>\n</body>\n</html>"
which I assume just means I’m using the wrong URL. Any suggestions appreciated.
Happy to share the specific Swift code, but this just seems like a basic question.