Skip to content

Commit

Permalink
pick=webdav-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Feb 2, 2024
1 parent 3e9315f commit d5d3697
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ generated `ticket` which acts as a transaction identifier and a `redirect_uri` p
* The client knows how to contact the auth server to exchange this refresh token for an access token
* The client now needs to discover access instructions. The client directly asks the resource server for this
### How is this different?
* the client sends 'a-webdav-folder' as the scope, and gets back a URL for a structured scope
* the client sends 'pick=webdav-folder' instead of 'scope=...', and gets back a URL for a structured scope
* this scope was chosen by the user at the resource server's scope selection interface, the auth server doesn't understand it, except for the `humanReadable` field which it can display.
* the client can deference the scope to discover the protocol version, resource URL, etc.

Expand Down
7 changes: 4 additions & 3 deletions phase-2/poc/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const screen1part1 = `
Here are some services you may want to share resources from, connected to your account:
<ul>
<li><a href="http://localhost:3003/scope?redirect_uri=` + encodeURIComponent(`http://localhost:3002/callback`) + `&state=`;
const screen1part2 = `">Research Drive</a></li>
const screen1part2 = `&pick=`;
const screen1part3 = `">Research Drive</a></li>
<li><a href="">iRods</a></li>
<li><a href="">Microsoft Outlook Calendar</a></li>
</ul>
Expand Down Expand Up @@ -60,7 +61,7 @@ http.createServer((req, res) => {
const url_parts = url.parse(req.url, true);
const query = url_parts.query;
console.log('new transaction', query);
if (query.scope == 'a-webdav-folder') {
if (query.pick == 'webdav-folder') {
console.log(`need to pick ${query.scope}!`);
if (query.state && query.redirect_uri) {
const clientTicket = query.state;
Expand All @@ -70,7 +71,7 @@ http.createServer((req, res) => {
clientTicket
};
console.log(tickets);
res.end(screen1part1 + resourceTicket + screen1part2);
res.end(screen1part1 + resourceTicket + screen1part2 + query.pick + screen1part3);
}
} else {
console.log(`need to dereference ${query.scope}`);
Expand Down
4 changes: 2 additions & 2 deletions phase-2/poc/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const screen1part1 = `
`response_type=code&` +
`client_id=ahxoh2ohTu&` +
`redirect_uri=` + encodeURIComponent(`http://localhost:3001/callback1`) + `&` +
`scope=a-webdav-folder&state=`;
`pick=webdav-folder&state=`;

const screen1part2 = `">here</a> to discover SRAM-based services to connect with your VM.</li>
<li>Click <a href="">here</a> to discover Danish services to connect with your VM.</li>
<li>Or go directly to <a href="http://localhost:3003/scope?redirect_uri=` + encodeURIComponent(`http://localhost:3001/callback2`) + `&state=`;
<li>Or go directly to <a href="http://localhost:3003/scope?redirect_uri=` + encodeURIComponent(`http://localhost:3001/callback2`) + `&pick=webdav-folder&state=`;
const screen1part3 = `">Research Drive</a></li>
<li>etc&hellip;</li>
</ul>
Expand Down

0 comments on commit d5d3697

Please sign in to comment.