Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: external login #1629

Merged
merged 4 commits into from
Feb 25, 2025
Merged

feat: external login #1629

merged 4 commits into from
Feb 25, 2025

Conversation

alanshaw
Copy link
Member

refs storacha/RFC#43

This PR adds a new method externalLogin() that allow login to the system via an external method (e.g. OAuth). It essentially bypasses email confirmation, assuming this is done out of band. We re-join the regular auth flow at the point when we claim the delegation (and attestation) from an email to the agent.

@@ -41,7 +41,7 @@ export const AuthorizationRequest = Schema.struct({
/**
* DID of the Account authorization is requested from.
*/
iss: Account,
iss: Account.optional(),
Copy link
Member Author

@alanshaw alanshaw Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now optional, as per the RFC.

In the case of OAuth login, we don't know the email address of the user until after they have authorized and we have issued the delegation and attestation on their behalf.

@@ -21,6 +21,10 @@ export const provide = (ctx) =>
* @returns {Promise<API.Transaction<API.AccessAuthorizeSuccess, API.AccessAuthorizeFailure>>}
*/
export const authorize = async ({ capability, invocation }, ctx) => {
if (!capability.nb.iss) {
return Server.error(new Error('Issuer is required in invoked authorization request.'))
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For regular email login we require issuer.

Copy link
Member

@fforbeck fforbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@alanshaw alanshaw merged commit 150b5d7 into main Feb 25, 2025
9 checks passed
@alanshaw alanshaw deleted the feat/external-login branch February 25, 2025 10:39
alanshaw pushed a commit that referenced this pull request Feb 25, 2025
🤖 I have created a release *beep* *boop*
---


##
[18.1.0](capabilities-v18.0.1...capabilities-v18.1.0)
(2025-02-25)


### Features

* external login ([#1629](#1629))
([150b5d7](150b5d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
alanshaw pushed a commit that referenced this pull request Feb 25, 2025
🤖 I have created a release *beep* *boop*
---


##
[20.2.0](access-v20.1.2...access-v20.2.0)
(2025-02-25)


### Features

* external login ([#1629](#1629))
([150b5d7](150b5d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
alanshaw pushed a commit that referenced this pull request Feb 25, 2025
🤖 I have created a release *beep* *boop*
---


##
[17.2.0](w3up-client-v17.1.2...w3up-client-v17.2.0)
(2025-02-25)


### Features

* external login ([#1629](#1629))
([150b5d7](150b5d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
alanshaw added a commit that referenced this pull request Feb 25, 2025
🤖 I have created a release *beep* *boop*
---


##
[19.1.0](upload-api-v19.0.0...upload-api-v19.1.0)
(2025-02-25)


### Features

* external login ([#1629](#1629))
([150b5d7](150b5d7))


### Other Changes

* upgrade dependencies for better de-duplication
([#1620](#1620))
([fa90a01](fa90a01))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ash <alan@storacha.network>
alanshaw added a commit to storacha/w3cli that referenced this pull request Feb 25, 2025
Allows login via github via:

```sh
w3 login --github
```

refs storacha/RFC#43
depends on storacha/w3up#1629
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants