Skip to content

Commit 06379cc

Browse files
author
aws-amplify-bot
committed
Merge remote-tracking branch 'origin/main' into pre-prod/main
2 parents 9727175 + 33ad5b7 commit 06379cc

File tree

7 files changed

+672
-342
lines changed

7 files changed

+672
-342
lines changed

src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -130,85 +130,6 @@ RxAmplify.Analytics.flushEvents();
130130

131131
When flushing events, a [Hub event](/[platform]/build-a-backend/auth/connect-your-frontend/listen-to-auth-events/) is sent containing the events which were successfully sent to the Pinpoint service. To receive a list of these events, subscribe to the `HubChannel.ANALYTICS` channel and handle an event of the type `AnalyticsChannelEventName.FLUSH_EVENTS`.
132132

133-
## Authentication events
134-
135-
Authentication events indicate how frequently users authenticate with your application.
136-
137-
On the **Analytics** page, the **Users** tab displays charts for **Sign-ins, Sign-ups, and Authentication failures**.
138-
139-
To learn how frequently users authenticate with your app, update your application code so that Amazon Pinpoint receives the following standard event types for authentication:
140-
141-
- `_userauth.sign_in`
142-
- `_userauth.sign_up`
143-
- `_userauth.auth_fail`
144-
145-
You can report authentication events by doing either of the following:
146-
147-
- Managing user sign-up and sign-in with Amazon Cognito user pools.
148-
149-
Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplify_outputs.json** by adding the `PinpointAppId` key under `CognitoUserPool`.
150-
151-
```json
152-
"CognitoUserPool": {
153-
"Default": {
154-
"PoolId": "<your-user-pool-id>",
155-
"AppClientId": "<your-app-client-id>",
156-
"Region": "<your-app-region>",
157-
"PinpointAppId": "<your-pinpoint-app-id>"
158-
}
159-
}
160-
```
161-
162-
- Manually recording events using the `recordEvent()` API.
163-
164-
If you don't want to use Cognito user pools, you can use the Pinpoint client to record and submit authentication events, as shown in the following examples. In these examples, the event type is set to `_userauth.sign_in`, but you can substitute any authentication event type.
165-
166-
<BlockSwitcher>
167-
<Block name="Java">
168-
169-
```java
170-
/**
171-
* Call this method to log an authentication event to the analytics client.
172-
*/
173-
public void logAuthenticationEvent() {
174-
AnalyticsEvent event = AnalyticsEvent.builder()
175-
.name("_userauth.sign_in")
176-
.build();
177-
Amplify.Analytics.recordEvent(event);
178-
}
179-
```
180-
181-
</Block>
182-
<Block name="Kotlin">
183-
184-
```kotlin
185-
/**
186-
* Call this method to log an authentication event to the analytics client.
187-
*/
188-
fun logAuthenticationEvent() {
189-
val event = AnalyticsEvent.builder()
190-
.name("_userauth.sign_in")
191-
.build()
192-
Amplify.Analytics.recordEvent(event)
193-
}
194-
```
195-
</Block>
196-
<Block name="RxJava">
197-
198-
```java
199-
200-
/**
201-
* Call this method to log an authentication event to the analytics client.
202-
*/
203-
public void logAuthenticationEvent() {
204-
AnalyticsEvent event = AnalyticsEvent.builder()
205-
.name("_userauth.sign_in")
206-
.build();
207-
RxAmplify.Analytics.recordEvent(event);
208-
}
209-
```
210-
</Block>
211-
</BlockSwitcher>
212133

213134
## Global Properties
214135

src/pages/[platform]/build-a-backend/auth/concepts/external-identity-providers/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ import 'aws-amplify/auth/enable-oauth-listener';
587587
import { getCurrentUser, fetchUserAttributes } from 'aws-amplify/auth';
588588
import { Hub } from 'aws-amplify/utils';
589589

590-
Hub.listen("auth", ({ payload }) => {
590+
Hub.listen("auth", async ({ payload }) => {
591591
switch (payload.event) {
592592
case "signInWithRedirect":
593593
const user = await getCurrentUser();

src/pages/[platform]/build-a-backend/auth/concepts/passwordless/index.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Passwordless authentication removes the security risks and user friction associa
4242

4343
</Callout>
4444

45-
Learn how to implement passwordless sign-in flows by [overriding the Cognito UserPool to enable the sign-in methods below](/[platform]/build-a-backend/auth/modify-resources-with-cdk/#override-cognito-userpool-to-enable-passwordless-sign-in-methods).
45+
Learn how to enable passwordless sign-in flows by [overriding the Cognito UserPool to enable the sign-in methods below](/[platform]/build-a-backend/auth/modify-resources-with-cdk/#override-cognito-userpool-to-enable-passwordless-sign-in-methods).
4646

4747
{/* need a section about what a "preferred" factor is */}
4848

@@ -131,7 +131,17 @@ WebAuthn uses biometrics or security keys for authentication, leveraging device-
131131
</InlineFilter>
132132
<InlineFilter filters={["android"]}>
133133

134-
{/* */}
134+
You can read more about how passkeys work in the [Android developer docs](https://developer.android.com/design/ui/mobile/guides/patterns/passkeys).
135+
136+
<Callout warning>
137+
Registering a passkey is supported on Android 9 (API level 28) and above.
138+
</Callout>
139+
140+
Using passkeys with Amplify requires following these steps:
141+
142+
1. Deploy a Digital Asset Links file to your website granting the `get_login_creds` permission to your application. See the [Credential Manager documentation](https://developer.android.com/identity/sign-in/credential-manager#add-support-dal) for more details about this file.
143+
1. [Configure your Amazon Cognito user pool](/[platform]/build-a-backend/auth/modify-resources-with-cdk/#override-cognito-userpool-to-enable-passwordless-sign-in-methods) with `WEB_AUTHN` as an allowed first factor, and specify your website domain as the `WebAuthnRelyingPartyID`.
144+
1. Use the Amplify Android APIs to first [register a passkey](/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials/#associate-webauthn-credentials) and then to [sign in with WebAuthn](/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/#webauthn-passkeys).
135145

136146
</InlineFilter>
137147
<InlineFilter filters={["swift"]}>
@@ -144,6 +154,6 @@ WebAuthn uses biometrics or security keys for authentication, leveraging device-
144154

145155
### Managing credentials
146156

147-
{/* quick blurb then segue over to "manage WebAuthn credentials" page */}
157+
Passwordless authentication with WebAuthn requires associating one or more credentials with the user's Amazon Cognito account. Amplify provides APIs that integrate with each platform's local authenticator to easily create, view, and delete these credential associations.
148158

149159
[Learn more about managing WebAuthn credentials](/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials).

0 commit comments

Comments
 (0)