(Legacy) Apple SSO Cookbook (REST API v1) apple-sso-cookbook-rest-api-v1

IMPORTANT
Der Inhalt dieser Seite dient nur zu Informationszwecken. Die Verwendung dieser API erfordert eine aktuelle Lizenz von Adobe. Eine unbefugte Nutzung ist nicht zulässig.
IMPORTANT
Achten Sie darauf, über die neuesten Ankündigungen zu Produkten der Adobe Pass-Authentifizierung und Stilllegungszeitpläne auf der Seite Produktankündigungen auf dem Laufenden zu bleiben.

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

TIP
Profi-Tipp: Die Streaming-Anwendung muss Zugriff auf die auf Geräteebene gespeicherten Abonnementinformationen des Benutzers anfordern, für die der Benutzer der Anwendung die Erlaubnis zum Fortfahren erteilen muss, ähnlich wie bei der Bereitstellung von Zugriff auf die Kamera oder das Mikrofon des Geräts. Diese Berechtigung muss pro Anwendung über das Apple-Video-Abonnementkonto-Framework angefordert werden und das Gerät speichert die Benutzerauswahl.
TIP
Profi-Tipp: Wir empfehlen, Benutzern, die sich weigern, Berechtigungen für den Zugriff auf Abonnementinformationen zu erteilen, Anreize zu bieten, indem sie die Vorteile des Apple-Single-Sign-On-Benutzererlebnisses erklären. Beachten Sie jedoch, dass die Benutzenden ihre Entscheidung ändern können, indem sie zu den Anwendungseinstellungen gehen (Zugriff auf TV-Anbieter) oder auf iOS und iPadOS oder Settings -> Accounts -> TV Provider auf tvOS Settings -> TV Provider.
TIP
Profi-Tipp: Es wird empfohlen, die Berechtigung des Benutzers anzufordern, wenn die Anwendung in den Vordergrundstatus wechselt, da die Anwendung jederzeit auf die Abonnementinformationen Zugriffsberechtigung“Benutzers prüfen kann, bevor eine Benutzerauthentifizierung erforderlich wird.

Authentifizierung apple-sso-cookbook-rest-api-v1-authentication

Schritt: „Gibt es ein gültiges Adobe-Authentifizierungstoken?“ step1

TIP
Tipp: Implementieren Sie dies über den API-Service zur Authentifizierung AuthentifizierungstokenAdobe Pass.

Schritt: „Ist der Benutzer über Partner-SSO angemeldet?“ step2

TIP
Tipp Implementieren Sie dies über das Video-Abonnementkonto-Framework.
  • 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.
TIP
Profi-Tipp Folgen Sie dem Code-Snippet und achten Sie besonders auf die Kommentare.
...
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

TIP
Tipp: Implementieren Sie dies über den API-Service zur Adobe Pass-Authentifizierung BereitstellungMVPD-Liste .
TIP
Profi-Tipp: Bitte beachten Sie die MVPD-Eigenschaften: 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

TIP
Tipp Implementieren Sie dies über das Video-Abonnementkonto-Framework.
  • 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.
TIP
Profi-Tipp Folgen Sie dem Code-Snippet und achten Sie besonders auf die Kommentare.
    ...
    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

TIP
Profi-Tipp: Beachten Sie das Code-Fragment aus dem -Schritt „Initiieren des Partner-SSO-Workflows mit Adobe-Konfiguration . Die Benutzeranmeldung ist erfolgreich, wenn die 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

TIP
Tipp: Implementieren Sie dies über den API-Service zur Authentifizierung Profilanfrage von Adobe Pass.
TIP
Profi-Tipp: Beachten Sie, dass die vom Framework für Videoabonnentenkonten erhaltene Provider-Kennung die 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

TIP
Tipp Implementieren Sie dies über das Video-Abonnementkonto-Framework.
  • 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.
TIP
Profi-Tipp Folgen Sie dem Code-Snippet und achten Sie besonders auf die Kommentare.
    ...
    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

TIP
Tipp: Implementieren Sie dies über den API-Service zur Adobe Pass-Authentifizierung Token-).
TIP
Profi-Tipp: Beachten Sie das Code-Fragment aus dem Schritt „Weiterleiten der Adobe-Anfrage an Partner-SSO zum Abrufen des Profils . Dieser 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

TIP
Tipp: Implementieren Sie dies über die erfolgreiche Antwort der Adobe Pass-Authentifizierung Token-Austausch, bei der es sich um eine 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

TIP
Profi-Tipp Führen Sie die folgenden Schritte für die tvOS-Implementierung(en) aus.
TIP
Profi-Tipp Führen Sie die folgenden Schritte für die Implementierung(en) von iOS/iPadOS aus.

Schritt: „Fortfahren mit Autorisierungsflüssen“ step11

TIP
Tipp: Implementieren Sie dies über die Adobe Pass-Authentifizierung Autorisierung initiieren und Short Media Token erhalten-API-Services.

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).

TIP
Tipp: Implementieren Sie dies über die Adobe Pass-Authentifizierung Benutzermetadaten-Aufruf und Abmelde-API-Services.
TIP
Profi-Tipp Führen Sie die folgenden Schritte für die tvOS-Implementierung(en) aus.
  • 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.
TIP
Profi-Tipp Führen Sie die folgenden Schritte für die Implementierung(en) von iOS/iPadOS aus.
  • 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.
recommendation-more-help
3f5e655c-af63-48cc-9769-2b6803cc5f4b