api.access
api.access.deny(reason)
api.accessToken
api.accessToken.setCustomClaim(key, value)
api.accessToken.addScope(scope)
api.accessToken.removeScope(scope)
api.authentication
api.authentication.challengeWith(factor, options)
- デフォルトの認証要素に対するチャレンジを正常に完了した場合。
additionalFactorsで指定された追加認証要素のいずれかに対するチャレンジを正常に完了した場合。
ユーザーがチャレンジの要件をまだ満たしていない場合、このメソッドにより認証要素のチャレンジ画面が表示されます。
additionalFactorsが指定されている場合、ユーザーは必要に応じて別の認証要素を選択できます。Challenge with a specific factor
Challenge with additional factors
Challenge with push notification and disable OTP fallback
api.authentication.challengeWithAny(factors)
- いずれかの認証要素に対するチャレンジを正常に完了した場合。
ユーザーがチャレンジの要件をまだ満たしていない場合、このメソッドによって認証要素選択画面が表示されます。優先する認証要素がある場合は、
api.authentication.challengeWith()メソッドの使用を推奨します。渡される認証要素が1つだけの場合、または有効な認証要素が1つだけの場合は、認証要素選択画面は表示されません。api.authentication.enrollWith(factor, options)
Enroll with additional factors
api.authentication.enrollWithAny(factors)
優先する認証要素がある場合は、
api.authentication.enrollWith()メソッドの使用をお勧めします。渡された認証要素が1つだけの場合、または有効な認証要素が1つだけの場合、認証要素選択画面は表示されません。api.authentication.recordMethod(provider_url)
event.authentication.methods 配列で利用できるようになります。
重要: この API は、PostLogin Actions の onContinuePostLogin
関数内でのみ使用できます。つまり、api.redirect.sendUserTo() でユーザーを
リダイレクトした後、カスタム認証方法の完了を記録するために使用できます。
パラメータ
api.authentication.setPrimaryUser(primary_user_id)
setPrimaryUser() 関数を使用して、ログインのsubjectを変更できます。
重要: 安全でない方法でアカウントをリンクすると、悪意のある第三者が正規のユーザーアカウントにアクセスできる可能性があります。
重要: ログインの認証に使用されるアイデンティティは、primary_user_id で参照されるユーザーのセカンダリアイデンティティのいずれかである必要があります。そうでない場合、ログインは失敗し、tokensは発行されません。
パラメータ
api.idToken
api.idToken.setCustomClaim(key, value)
api.multifactor
api.multifactor.enable(provider, options)
api.redirect
api.redirect.encodeToken(options)
sendUserTo 経由) に使用できるsession tokenを作成します。
このtokenには、リダイレクト先のエンドポイントが真正性を証明する必要があるデータが含まれます。リダイレクト先のエンドポイントでは、
共有secretを使用してJWTの署名を検証することで、データの真正性と完全性を
確認できます。
共有secretは、Actionのsecretとして保存する必要があり、
event.secrets['<secret_name>']から読み取れます。
パラメータ
api.redirect.sendUserTo(url, options)
url にリダイレクトします。createUrl ヘルパーメソッドを使用すると、対象の url のクエリパラメータとしてデータをエンコードする処理を簡略化でき、対象の エンドポイント でデータの真正性と完全性を検証できます。
パラメータ
api.redirect.canRedirect()
oauth2-resource-owner や oauth2-refresh-token などの一部のプロトコルでは、ユーザーをリダイレクトできません。prompt=none を含むrequestもリダイレクトの対象外です。
api.redirect.validateToken(options)
/continue エンドポイントに渡された JWT token にエンコードされたデータを取得し、
その真正性と完全性を検証します。
パラメータ
api.user
api.user.setAppMetadata(key, value)
api.user.setUserMetadata(key, value)
api.cache
api.cache.delete(key)
api.cache.get(key)
value プロパティに格納されています。
パラメータ
api.cache.set(key, value, options)
ttl または expires_at の値までとなります。有効期間を指定しない場合は、デフォルトで
15 分間となります。有効期間は、Actions Cache Limits に記載されている最大
期間を超えることはできません。
重要: このキャッシュは、短期間のみ使用する一時的なデータ向けに設計されています。指定した有効期間内であっても、
後続のトランザクションでは項目を利用できない場合があります。
パラメータ
api.samlResponse
api.samlResponse.setAttribute(attribute, value)
api.samlResponse.setAudience(audience)
api.samlResponse.setRecipient(recipient)
api.samlResponse.setCreateUpnClaim(createUpnClaim)
api.samlResponse.setPassthroughClaimsWithNoMapping(passthroughClaimsWithNoMapping)
api.samlResponse.setMapUnknownClaimsAsIs(mapUnknownClaimsAsIs)
http://schema.auth0.com というプレフィックスを追加します。
true の場合、クレームはそのまま渡されます。
パラメータ
api.samlResponse.setMapIdentities(mapIdentities)
api.samlResponse.setSignatureAlgorithm(signatureAlgorithm)
rsa-sha256 です。
パラメータ
api.samlResponse.setSignatureAlgorithm(signatureAlgorithm)
api.samlResponse.setDigestAlgorithm(digestAlgorithm)
api.samlResponse.setDigestAlgorithm(digestAlgorithm)
api.samlResponse.setDestination(destination)
api.samlResponse.setLifetimeInSeconds(lifetimeInSeconds)
api.samlResponse.setSignResponse(signResponse)
api.samlResponse.setNameIdentifierFormat(nameIdentifierFormat)
api.samlResponse.setNameIdentifierProbes(nameIdentifierProbes)
- http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier (user_id からマッピング)
- http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress (email からマッピング)
- http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name (name からマッピング)
api.samlResponse.setAuthnContextClassRef(authnContextClassRef)
urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified です。
パラメータ
api.samlResponse.setSigningCert(signingCert)
api.samlResponse.setIncludeAttributeNameFormat(includeAttributeNameFormat)
api.samlResponse.setTypedAttributes(typedAttributes)
api.samlResponse.setEncryptionCert(encryptionCert)
api.samlResponse.setEncryptionPublicKey(encryptionPublicKey)
api.samlResponse.setCert(cert)
api.samlResponse.setKey(key)
"-----BEGIN PRIVATE KEY-----\nnMIIC8jCCAdqgAwIBAgIJObB6jmhG0QIEMA0GCSqGSIb3DQEBBQUAMCAxHjAcBgNV\n[..その他のすべての行..]-----END PRIVATE KEY-----\n"
パラメータ
api.samlResponse.setRelayState(relayState)
api.samlResponse.setIssuer(issuer)
urn:auth0:TENANT です。
パラメータ
api.samlResponse.setEncryptionAlgorithm(encryptionAlgorithm)
Set the encryption algorithm to aes256-gcm (recommended)
api.samlResponse.setEncryptionAlgorithm(encryptionAlgorithm)
Set encryption algorithm to aes256-cbc (not recommended)
api.validation
api.validation.error(errorCode, errorMessage)
api.rules
api.rules.wasExecuted(ruleId)
api.prompt
api.prompt.render(promptId, promptOptions)
api.refreshToken
api.refreshToken.revoke(reason)
event.transaction.protocol === "oauth2-refresh-token" の場合にのみ、リフレッシュトークン交換フロー中で使用できます。
パラメータ
api.refreshToken.setExpiresAt(absolute)
api.refreshToken.setIdleExpiresAt(inactivity)
api.refreshToken.setMetadata(key, value)
api.refreshToken.deleteMetadata(key)
api.refreshToken.evictMetadata()
api.session
api.session.revoke(reason, options)
Revoke the session while preserving refresh tokens
api.session.setExpiresAt(absolute)
api.session.setIdleExpiresAt(inactivity)
- 「persistent」: Cookie は有効期限が切れるか、ユーザーによって削除されるまで保存されます。
- 「non-persistent」 (一時的) : ブラウザを閉じると Cookie は削除されます。
api.session.setMetadata(key, value)
api.session.deleteMetadata(key)
api.session.evictMetadata()
api.transaction
api.transaction.setMetadata(key, value)
event.transaction.metadata オブジェクトにリアルタイムで反映されます。
パラメータ
api.groups
api.groups.getUserGroups(params)
api.groups.hasGroupMembership(groups)
api.roles
api.roles.getUserEffectiveRoles(params)
Fetch the first page of roles
Paginate through roles
api.roles.getUserEffectiveRolesByIds(ids)
Filter roles by specific IDs
api.roles.getUserEffectiveRolesByNames(names)
Filter roles by specific names