(Legacy) Apple SSO Cookbook (REST API v1) apple-sso-cookbook-rest-api-v1
Die Adobe Pass-Authentifizierungs-REST-API V1 unterstützt das Partner Single Sign-On (SSO) für Endbenutzer von Client-Anwendungen, die auf iOS, iPadOS oder tvOS ausgeführt werden.
Dieses Dokument dient als Erweiterung der vorhandenen REST API V1-Dokumentation, die Sie ().
Cookbook apple-sso-cookbook-rest-api-v1-cookbook
Um von dem Apple SSO-Benutzererlebnis zu profitieren, muss die Anwendung das von Apple entwickelte Video Subscriber Account Framework integrieren, während sie für die Adobe Pass Authentication REST API V1-Kommunikation die unten beschriebene Reihenfolge der Schritte befolgen muss.
Erlaubnis apple-sso-cookbook-rest-api-v1-permission
Settings -> Accounts -> TV Provider
auf tvOS Settings -> TV Provider
.Authentifizierung apple-sso-cookbook-rest-api-v1-authentication
- Gibt es ein gültiges Adobe-Authentifizierungstoken?
- Ist der Benutzer über Partner-SSO angemeldet?
- Adobe-Konfiguration abrufen
- Starten des Partner-SSO-Workflows mit der Adobe-Konfiguration
- Ist die Benutzeranmeldung erfolgreich?
- Profilanfrage von Adobe für die ausgewählte MVPD abrufen
- Leiten Sie die Adobe-Anfrage an Partner-SSO weiter, um das Profil zu erhalten.
- Austausch des Partner-SSO-Profils gegen ein Adobe-Authentifizierungstoken
- Wird das Adobe-Token erfolgreich generiert?
- Starten eines regulären Authentifizierungs-Workflows
- Fortfahren mit Autorisierungsflüssen
Schritt: „Gibt es ein gültiges Adobe-Authentifizierungstoken?“ step1
Schritt: „Ist der Benutzer über Partner-SSO angemeldet?“ step2
- Die Anwendung muss die Abonnementinformationen des Benutzers auf Zugriffsberechtigung überprüfen und nur fortfahren, wenn der Benutzer dies zulässt.
- Der Antrag müsste eine Anfrage für Abonnentenkontoinformationen einreichen.
- Die Anwendung muss warten und die Metadaten-Informationen verarbeiten.
...
let videoSubscriberAccountManager: VSAccountManager = VSAccountManager();
videoSubscriberAccountManager.checkAccessStatus(options: [VSCheckAccessOption.prompt: true]) { (accessStatus, error) -> Void in
switch (accessStatus) {
// The user allows the application to access subscription information.
case VSAccountAccessStatus.granted:
// Construct the request for subscriber account information.
let vsaMetadataRequest: VSAccountMetadataRequest = VSAccountMetadataRequest();
// This is actually the SAML Issuer not the channel ID.
vsaMetadataRequest.channelIdentifier = "https://saml.sp.auth.adobe.com";
// This is the subscription account information needed at this step.
vsaMetadataRequest.includeAccountProviderIdentifier = true;
// This is the subscription account information needed at this step.
vsaMetadataRequest.includeAuthenticationExpirationDate = true;
// This is going to make the Video Subscriber Account Framework to refrain from prompting the user with the providers picker at this step.
vsaMetadataRequest.isInterruptionAllowed = false;
// Submit the request for subscriber account information - accountProviderIdentifier.
videoSubscriberAccountManager.enqueue(vsaMetadataRequest) { vsaMetadata, vsaError in
if (vsaMetadata != nil && vsaMetadata!.accountProviderIdentifier != nil) {
// The vsaMetadata!.authenticationExpirationDate will contain the expiration date for current authentication session.
// The vsaMetadata!.authenticationExpirationDate should be compared against current date.
...
// The vsaMetadata!.accountProviderIdentifier will contain the provider identifier as it is known for the platform configuration.
// The vsaMetadata!.accountProviderIdentifier represents the platformMappingId in terms of Adobe Pass Authentication configuration.
...
// The application must determine the MVPD id property value based on the platformMappingId property value obtained above.
// The application must use the MVPD id further in its communication with Adobe Pass Authentication services.
...
// Continue with the "Obtain a profile request from Adobe for the selected MVPD" step.
...
// Continue with the "Forward the Adobe request to Partner SSO to obtain the profile" step.
...
} else {
// The user is not authenticated at platform level, continue with the "Fetch Adobe configuration" step.
...
}
}
// The user has not yet made a choice or does not allow the application to access subscription information.
default:
// Continue with the "Initiate regular authentication workflow" step.
...
}
}
...
Schritt: "Adobe-Konfiguration abrufen“ step3
enablePlatformServices
, boardingStatus
, displayInPlatformPicker
, platformMappingId
, requiredMetadataFields
und achten Sie besonders auf die Kommentare, die in Codeausschnitten aus anderen Schritten präsentiert werden.Schritt „Initiieren des Partner-SSO-Workflows mit Adobe-Konfiguration“ step4
- Die Anwendung muss die Abonnementinformationen des Benutzers auf Zugriffsberechtigung überprüfen und nur fortfahren, wenn der Benutzer dies zulässt.
- Die Anwendung muss einen "" fürVSAccountManager bereitstellen.
- Der Antrag müsste eine Anfrage für Abonnentenkontoinformationen einreichen.
- Die Anwendung muss warten und die Metadaten-Informationen verarbeiten.
...
let videoSubscriberAccountManager: VSAccountManager = VSAccountManager();
// This must be a class implementing the VSAccountManagerDelegate protocol.
let videoSubscriberAccountManagerDelegate: VideoSubscriberAccountManagerDelegate = VideoSubscriberAccountManagerDelegate();
videoSubscriberAccountManager.delegate = videoSubscriberAccountManagerDelegate;
videoSubscriberAccountManager.checkAccessStatus(options: [VSCheckAccessOption.prompt: true]) { (accessStatus, error) -> Void in
switch (accessStatus) {
// The user allows the application to access subscription information.
case VSAccountAccessStatus.granted:
// Construct the request for subscriber account information.
let vsaMetadataRequest: VSAccountMetadataRequest = VSAccountMetadataRequest();
// This is actually the SAML Issuer not the channel ID.
vsaMetadataRequest.channelIdentifier = "https://saml.sp.auth.adobe.com";
// This is the subscription account information needed at this step.
vsaMetadataRequest.includeAccountProviderIdentifier = true;
// This is the subscription account information needed at this step.
vsaMetadataRequest.includeAuthenticationExpirationDate = true;
// This is going to make the Video Subscriber Account Framework to prompt the user with the providers picker at this step.
vsaMetadataRequest.isInterruptionAllowed = true;
// This can be computed from the [Adobe Pass Authentication](/docs/pass/authentication/provide-mvpd-list.md) service response in order to filter the TV providers from the Apple picker.
vsaMetadataRequest.supportedAccountProviderIdentifiers = supportedAccountProviderIdentifiers;
// This can be computed from the [Adobe Pass Authentication](/docs/pass/authentication/provide-mvpd-list.md) service response in order to sort the TV providers from the Apple picker.
if #available(iOS 11.0, tvOS 11, *) {
vsaMetadataRequest.featuredAccountProviderIdentifiers = featuredAccountProviderIdentifiers;
}
// Submit the request for subscriber account information - accountProviderIdentifier.
videoSubscriberAccountManager.enqueue(vsaMetadataRequest) { vsaMetadata, vsaError in
// This represents the checks for the "Is user login successful?" step.
if (vsaMetadata != nil && vsaMetadata!.accountProviderIdentifier != nil) {
// The vsaMetadata!.authenticationExpirationDate will contain the expiration date for current authentication session.
// The vsaMetadata!.authenticationExpirationDate should be compared against current date.
...
// The vsaMetadata!.accountProviderIdentifier will contain the provider identifier as it is known for the platform configuration.
// The vsaMetadata!.accountProviderIdentifier represents the platformMappingId in terms of Adobe Pass Authentication configuration.
...
// The application must determine the MVPD id property value based on the platformMappingId property value obtained above.
// The application must use the MVPD id further in its communication with Adobe Pass Authentication services.
...
// Continue with the "Obtain a profile request from Adobe for the selected MVPD" step.
...
// Continue with the "Forward the Adobe request to Partner SSO to obtain the profile" step.
...
} else {
// The user is not authenticated at platform level.
if (vsaError != nil) {
// The application can check to see if the user selected a provider which is present in Apple picker, but the provider is not onboarded in platform SSO.
if let error: NSError = (vsaError! as NSError), error.code == 1, let appleMsoId = error.userInfo["VSErrorInfoKeyUnsupportedProviderIdentifier"] as! String? {
var mvpd: Mvpd? = nil;
// The requestor.mvpds must be computed during the "Fetch Adobe configuration" step.
for provider in requestor.mvpds {
if provider.platformMappingId == appleMsoId {
mvpd = provider;
break;
}
}
if mvpd != nil {
// Continue with the "Initiate regular authentication workflow" step, but you can skip prompting the user with your MVPD picker and use the mvpd selection, therefore creating a better UX.
...
} else {
// Continue with the "Initiate regular authentication workflow" step.
...
}
} else {
// Continue with the "Initiate regular authentication workflow" step.
...
}
} else {
// Continue with the "Initiate regular authentication workflow" step.
...
}
}
}
// The user has not yet made a choice or does not allow the application to access subscription information.
default:
// Continue with the "Initiate regular authentication workflow" step.
...
}
}
...
Schritt: „Ist die Benutzeranmeldung erfolgreich?“ step5
vsaMetadata!.accountProviderIdentifier
einen gültigen Wert enthält und das aktuelle Datum den vsaMetadata!.authenticationExpirationDate
nicht überschritten hat.Schritt „Profilanfrage von Adobe für die ausgewählte MVPD abrufen“ step6
platformMappingId
in Bezug auf die Adobe Pass-Authentifizierungskonfiguration darstellt. Daher muss die Anwendung den Eigenschaftswert der MVPD-ID mithilfe des platformMappingId
-Werts über den API-Service für die Adobe Pass-Authentifizierung MVPD-Liste bereitstellen ermitteln.Schritt: „Weiterleiten der Adobe-Anfrage an Partner-SSO, um das Profil zu erhalten“ step7
- Die Anwendung muss die Abonnementinformationen des Benutzers auf Zugriffsberechtigung überprüfen und nur fortfahren, wenn der Benutzer dies zulässt.
- Der Antrag müsste eine Anfrage für Abonnentenkontoinformationen einreichen.
- Die Anwendung muss warten und die Metadaten-Informationen verarbeiten.
...
let videoSubscriberAccountManager: VSAccountManager = VSAccountManager();
videoSubscriberAccountManager.checkAccessStatus(options: [VSCheckAccessOption.prompt: true]) { (accessStatus, error) -> Void in
switch (accessStatus) {
// The user allows the application to access subscription information.
case VSAccountAccessStatus.granted:
// Construct the request for subscriber account information.
let vsaMetadataRequest: VSAccountMetadataRequest = VSAccountMetadataRequest();
// This is actually the SAML Issuer not the channel ID.
vsaMetadataRequest.channelIdentifier = "https://saml.sp.auth.adobe.com";
// This is going to include subscription account information which should match the provider determined in a previous step.
vsaMetadataRequest.includeAccountProviderIdentifier = true;
// This is going to include subscription account information which should match the provider determined in a previous step.
vsaMetadataRequest.includeAuthenticationExpirationDate = true;
// This is going to make the Video Subscriber Account Framework to refrain from prompting the user with the providers picker at this step.
vsaMetadataRequest.isInterruptionAllowed = false;
// This are the user metadata fields expected to be available on a successful login and are determined from the [Adobe Pass Authentication](/docs/pass/authentication/provide-mvpd-list.md) service. Look for the requiredMetadataFields associated with the provider determined in a previous step.
vsaMetadataRequest.attributeNames = requiredMetadataFields;
// This is the payload from [Adobe Pass Authentication](/docs/pass/authentication/retrieve-profilerequest.md) service.
vsaMetadataRequest.verificationToken = profileRequestPayload;
// Submit the request for subscriber account information.
videoSubscriberAccountManager.enqueue(vsaMetadataRequest) { vsaMetadata, vsaError in
if (vsaMetadata != nil && vsaMetadata!.samlAttributeQueryResponse != nil) {
var samlResponse: String? = vsaMetadata!.samlAttributeQueryResponse!;
// Remove new lines, new tabs and spaces.
samlResponse = samlResponse?.replacingOccurrences(of: "[ \\t]+", with: " ", options: String.CompareOptions.regularExpression);
samlResponse = samlResponse?.components(separatedBy: CharacterSet.newlines).joined(separator: "");
samlResponse = samlResponse?.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines);
// Base64 encode.
samlResponse = samlResponse?.data(using: .utf8)?.base64EncodedString(options: []);
// URL encode. Please be aware not to double URL encode it further.
samlResponse = samlResponse?.addingPercentEncoding(withAllowedCharacters: CharacterSet.init(charactersIn: "!*'();:@&=+$,/?%#[]").inverted);
// Continue with the "Exchange the Partner SSO profile for an Adobe authentication token" step.
...
} else {
// Continue with the "Initiate regular authentication workflow" step.
...
}
}
// The user has not yet made a choice or does not allow the application to access subscription information.
default:
// Continue with the "Initiate regular authentication workflow" step.
...
}
}
...
Schritt: „Partner-SSO-Profil gegen ein Adobe-Authentifizierungstoken austauschen“ step8
vsaMetadata!.samlAttributeQueryResponse!
stellt den SAMLResponse
dar, der an den Token Exchange übergeben werden muss und vor dem Aufruf eine Zeichenfolgenmanipulation und -codierung erfordert (Base64-codiert und URL-codiert).Schritt: „Wird das Adobe-Token erfolgreich generiert?“ step9
204 No Content
handelt, die angibt, dass das Token erfolgreich erstellt wurde und für die Autorisierungsflüsse verwendet werden kann.Schritt: „Initiieren eines regulären Authentifizierungs-Workflows“ step10
- Die Anwendung müsste einen Registrierungscode abrufen und ihn dem Endbenutzer auf dem 1. Gerät (Bildschirm) präsentieren.
- Die Anwendung müsste auf dem 1 Gerät (Bildschirm) nach Erhalt des RegistrierungsCodes mit der Abfrage beginnen, um den Authentifizierungsstatus zu bestätigen.
- Eine andere Anwendung müsste Authentifizierung initiieren auf einem zweiten Gerät (Bildschirm), wenn der Registrierungs-Code verwendet wird.
- Die Anwendung muss den (Polling auf dem ersten Gerät (Bildschirm) stoppen, wenn das Authentifizierungs-Token generiert wird.
- Die Anwendung muss einen Registrierungs-Code erhalten der dem Endbenutzer nicht auf dem ersten Gerät (Bildschirm) angezeigt werden sollte.
- Die Anwendung müsste Authentifizierung initiieren auf dem ersten Gerät (Bildschirm) mithilfe des Registrierungs-Codes und einer WKWebView- oder SFSafariViewController-Komponente.
- Die Anwendung muss auf dem 1. Gerät () mit dem Abruf beginnen, um den Authentifizierungsstatus zu, nachdem die Komponente WKWebView oder SFSafariViewController geschlossen wurde.
- Die Anwendung muss den (Polling auf dem ersten Gerät (Bildschirm) stoppen, wenn das Authentifizierungs-Token generiert wird.
Schritt: „Fortfahren mit Autorisierungsflüssen“ step11
Abmelden apple-sso-cookbook-rest-api-v1-logout
Das Video Subscriber Account Framework stellt keine API zum programmgesteuerten Abmelden von Personen bereit, die sich auf Gerätesystemebene bei ihrem TV Provider-Konto angemeldet haben. Damit die Abmeldung ihre volle Wirkung entfalten kann, muss sich der Endbenutzer daher explizit von Settings -> TV Provider
auf iOS/iPadOS oder Settings -> Accounts -> TV Provider
auf tvOS abmelden. Die andere Option, die der Benutzer haben könnte, besteht darin, dem Benutzer die Berechtigung zum Zugriff auf die Abonnementinformationen des Benutzers über den Abschnitt mit den spezifischen Anwendungseinstellungen zu entziehen (TV Provider-Zugriff).
- Die Anwendung muss mithilfe von "tokenSource“ (Benutzermetadaten) aus dem Adobe Pass-Authentifizierungsdienst feststellen, ob die Authentifizierung als Ergebnis einer Anmeldung über 🔗 Partner-SSO erfolgt .
- Die Anwendung muss den Benutzer anweisen/auffordern, sich explizit von
Settings -> Accounts -> TV Provider
unter tvOS abzumelden nur, wenn der „tokenSource“ Wert "Apple" entspricht. - Die Anwendung müsste Abmelden) vom Adobe Pass-AuthentifizierungsService über einen direkten HTTP-Aufruf starten. Dies würde die Sitzungsbereinigung auf MVPD-Seite nicht erleichtern.
- Die Anwendung muss mithilfe von "tokenSource“ (Benutzermetadaten) aus dem Adobe Pass-Authentifizierungsdienst feststellen, ob die Authentifizierung als Ergebnis einer Anmeldung über 🔗 Partner-SSO erfolgt .
- Die Anwendung müsste den Benutzer anweisen/auffordern, sich explizit von
Settings -> TV Provider
auf iOS/iPadOS abzumelden nur wenn der „tokenSource“ Wert "Apple". - Die Anwendung müsste Abmelden) vom Adobe Pass-Authentifizierungsdiensteiner WKWebView- oder SFSafariViewController-Komponente initiieren. Dies würde die Sitzungsbereinigung auf MVPD-Seite erleichtern.