-
Notifications
You must be signed in to change notification settings - Fork 88
(DOCSP-39531): Consolidate Link User Identities page #3350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dacharyc
merged 4 commits into
mongodb:feature-consolidated-sdk-docs
from
dacharyc:DOCSP-39531
Aug 8, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.../includes/api-details/csharp/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
You can link identities using the | ||
:dotnet-sdk:`LinkCredentialsAsync() <reference/Realms.Sync.User.html#Realms_Sync_User_LinkCredentialsAsync_Realms_Sync_Credentials_>`. | ||
This links the identity belonging to the credentials to the logged-in | ||
:dotnet-sdk:`User <reference/Realms.Sync.User.html>` object. | ||
|
||
.. literalinclude:: /examples/generated/dotnet/UserLinkExamples.snippet.link.cs | ||
:language: csharp | ||
|
||
In the example above, we must first register the new :ref:`email/password | ||
<email-password-authentication>` user before linking. If you are using any of | ||
the other :ref:`Auth Providers <authentication-providers>`, this step is | ||
unnecessary. The following example uses :ref:`Google authentication | ||
<google-authentication>` instead of EmailPassword. |
8 changes: 8 additions & 0 deletions
8
...ce/includes/api-details/dart/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
You can link identities by passing the :flutter-sdk:`Credentials <realm/Credentials-class.html>` | ||
that you want to link to :flutter-sdk:`User.linkCredentials() <realm/User/linkCredentials.html>`. | ||
|
||
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.link-user-credentials.dart | ||
:language: dart | ||
|
||
In the example below, we register an anonymous user, then later register an | ||
email/password user and link the credentials. |
6 changes: 6 additions & 0 deletions
6
...ce/includes/api-details/java/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
You link identities using | ||
:java-sdk:`linkCredentials() <io/realm/mongodb/User.html#linkCredentials-io.realm.mongodb.Credentials->` | ||
or :java-sdk:`linkCredentialsAsync() | ||
<io/realm/mongodb/User.html#linkCredentialsAsync-io.realm.mongodb.Credentials-io.realm.mongodb.App.Callback->`. | ||
dacharyc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This links the new user identity to the logged-in :java-sdk:`User | ||
<io/realm/mongodb/User.html>` object. |
4 changes: 4 additions & 0 deletions
4
...api-details/javascript/users/link-user-identities-example-js-ts-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
You can link identities using :js-sdk:`linkCredentials() | ||
<classes/User.html#linkCredentials>`. This links the identity that belongs | ||
to the credential to a logged-in ``User`` object. |
4 changes: 4 additions & 0 deletions
4
.../includes/api-details/kotlin/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
You link identities using | ||
:kotlin-sync-sdk:`linkCredentials <io.realm.kotlin.mongodb/-user/link-credentials.html>`. | ||
This links the identity belonging to the credential to the logged-in | ||
:kotlin-sync-sdk:`User <io.realm.kotlin.mongodb/-user/index.html>`. |
4 changes: 4 additions & 0 deletions
4
...ludes/api-details/objectivec/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
You can link identities using :objc-sdk:`-linkUserWithCredentials:completion: | ||
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)linkUserWithCredentials:completion:>`. | ||
This links the identity that belongs to the credential to a logged-in ``User`` | ||
object. |
10 changes: 10 additions & 0 deletions
10
...e/includes/api-details/swift/users/link-user-identities-example-description.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
You can link identities using :swift-sdk:`linkUser(credentials:) | ||
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE8linkUser11credentials7Combine6FutureCyABs5Error_pGAC11CredentialsO_tF>`. | ||
This links the identity that belongs to the credential to a logged-in ``User`` | ||
object. | ||
|
||
.. literalinclude:: /examples/generated/code/start/MultipleUsers.snippet.link-identity.swift | ||
:language: swift | ||
|
||
The SDK also provides an :swift-sdk:`async/await version of | ||
User.linkUser <Extensions/User.html#/s:So7RLMUserC10RealmSwiftE8linkUser11credentials7Combine6FutureCyABs5Error_pGAC11CredentialsO_tF>`. |
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
source/includes/sdk-examples/users/link-user-identities-example.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. tabs-drivers:: | ||
|
||
tabs: | ||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/dotnet/UserLinkExamples.snippet.link2.cs | ||
:language: csharp | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.link-user-credentials-example.dart | ||
:language: dart | ||
|
||
- id: java | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/java/sync/LinkUserIdentitiesTest.snippet.link-users.java | ||
:language: java | ||
|
||
- id: java-kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/java/sync/LinkUserIdentitiesTest.snippet.link-users.kt | ||
:language: kotlin | ||
|
||
- id: javascript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/link-identities.snippet.link-identities.js | ||
:language: javascript | ||
:emphasize-lines: 6 | ||
|
||
- id: kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.link-credentials.kt | ||
:language: kotlin | ||
|
||
- id: objectivec | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/MultipleUsers.snippet.link-identity-objc.m | ||
:language: objectivec | ||
|
||
- id: swift | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/MultipleUsers.snippet.async-link-identity.swift | ||
:language: swift | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/link-identities.snippet.link-identities.ts | ||
:language: typescript | ||
:emphasize-lines: 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.