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

IMPORTANT
De inhoud op deze pagina wordt alleen ter informatie verstrekt. Voor het gebruik van deze API is een huidige licentie van Adobe vereist. Ongeautoriseerd gebruik is niet toegestaan.
IMPORTANT
Zorg ervoor u over de recentste het productmededelingen van de Authentificatie van Adobe Pass en ontmantelingschronologie wordt geïnformeerd die in de ​ pagina van de Mededelingen van het Product ​ wordt samengevoegd.

De Adobe Pass Authentication REST API V1 biedt ondersteuning voor Single Sign-On (SSO) voor eindgebruikers van clienttoepassingen die op iOS, iPadOS of tvOS worden uitgevoerd.

Dit document doet dienst als uitbreiding aan de bestaande REST API V1 documentatie, die ​ hier ​ kan worden gevonden.

Cookbook apple-sso-cookbook-rest-api-v1-cookbook

Om van de gebruikerservaring van Apple te profiteren SSO, moet de toepassing het ​ Video Kader van de Rekening van de Abonnee van de Abonnee ​ integreren dat door Apple wordt ontwikkeld, terwijl voor de Communicatie van de Authentificatie van Adobe Pass REST API V1, het de opeenvolging van hieronder voorgestelde stappen moet volgen.

Machtiging apple-sso-cookbook-rest-api-v1-permission

TIP
ProUiteinde: de het stromen toepassing moet toegang tot de het abonnementinformatie van de gebruiker verzoeken die op apparatenniveau wordt bewaard, waarvoor de gebruiker de toepassingstoestemming moet geven te werk te gaan, gelijkend op het verlenen van toegang tot de camera of microfoon van het apparaat. Deze toestemming moet per toepassing worden gevraagd gebruikend het Kader van de Rekening van de Abonnee van Apple ​ Video ​ en het apparaat zal de selectie van de gebruiker bewaren.
TIP
ProUiteinde: wij adviseren gebruikers te stimuleren die weigeren om toestemming te geven om tot abonnementinformatie toegang te hebben door de voordelen van de enige sign-on gebruikerservaring van Apple uit te leggen, maar zich ervan bewust te zijn dat de gebruiker hun besluit kan veranderen door naar de toepassingsmontages (de toestemmingstoegang van TV Provider) of naar Settings -> TV Provider op iOS en iPadOS of Settings -> Accounts -> TV Provider op tvOS te gaan.
TIP
ProUiteinde: wij adviseren het verzoeken van de toestemming van de gebruiker wanneer de toepassing de voorgrondstaat ingaat, omdat de toepassing ​ toestemming kan controleren om tot ​ de het abonnementsinformatie van de gebruiker op om het even welk punt toegang te hebben alvorens gebruikersauthentificatie te vereisen.

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

Stap: "Is er een geldig Adobe-verificatietoken?" step1

TIP
Uiteinde: voer dit door het middel van de 2} Symbolische dienst van de Authentificatie van de Controle van Adobe Pass uit ​ API.

Stap: "Is de gebruiker het programma geopend via Partner SSO?" step2

TIP
Uiteinde: voer dit door het middel van ​ Video Kader van de Rekening van de Abonnee ​ uit.
TIP
ProUiteinde: volg het codefragment en let extra aandacht op de commentaren.
...
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.
                ...
            }
}
...

Stap: "Adobe-configuratie ophalen" step3

TIP
Uiteinde: voer dit door het middel van de Authentificatie van Adobe Pass ​ uit verleent de dienst van MVPD van de Lijst ​ API.
TIP
ProTip: gelieve zich van de eigenschappen van MVPD bewust te zijn: enablePlatformServices, boardingStatus, displayInPlatformPicker, platformMappingId, requiredMetadataFields en extra aandacht te besteden aan de commentaren die in codefragmenten van andere stappen worden voorgesteld.

Stap "De werkschema van SSO van de Partner met Adobe config"initialiseren step4

TIP
Uiteinde: voer dit door het middel van ​ Video Kader van de Rekening van de Abonnee ​ uit.
TIP
ProUiteinde: volg het codefragment en let extra aandacht op de commentaren.
    ...
    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.
                    ...
                }
    }
    ...

Stap: "Is gebruikersaanmelding geslaagd?" step5

TIP
ProUiteinde: gelieve zich van het codefragment van ​ bewust te zijn "de werkschema's van SSO van de Partner met Adobe config"beginnen ​ stap. De gebruikersaanmelding is geslaagd als de waarde van vsaMetadata!.accountProviderIdentifier geldig is en de huidige datum niet de waarde van vsaMetadata!.authenticationExpirationDate heeft bereikt.

Stap "Vraag een profielverzoek van Adobe aan voor de geselecteerde MVPD" step6

TIP
Uiteinde: voer dit door het middel van de 2} het Verzoek van het Profiel van Adobe Pass Authentificatie ​ API dienst uit.
TIP
ProTip: gelieve zich ervan bewust te zijn dat het leveranciersidentificatie die van het Video Kader van de Rekening van de Abonnee wordt verkregen platformMappingId in termen van de configuratie van de Authentificatie van Adobe Pass vertegenwoordigt. Daarom moet de toepassing de het bezitswaarde van identiteitskaart van MVPD bepalen, gebruikend de platformMappingId waarde, door het middel van de Authentificatie van Adobe Pass ​ verstrekt de dienst van MVPD Lijst ​ API.

Stap: "Het Adobe-verzoek doorsturen naar Partner SSO om het profiel te verkrijgen" step7

TIP
Uiteinde: voer dit door het middel van ​ Video Kader van de Rekening van de Abonnee ​ uit.
TIP
ProUiteinde: volg het codefragment en let extra aandacht op de commentaren.
    ...
    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.
                    ...
                }
    }
    ...

Stap: "Exchange the Partner SSO profile for an Adobe authentication token" step8

TIP
Uiteinde: voer dit door het middel van de 2} Symbolische dienst van de Uitwisseling van de Authentificatie van Adobe Pass ​ API uit.
TIP
ProUiteinde: gelieve zich van het codefragment van ​ bewust te zijn "door:sturen het verzoek van Adobe aan Partner SSO om het profiel"te verkrijgen ​ stap. Dit vsaMetadata!.samlAttributeQueryResponse! vertegenwoordigt SAMLResponse, die op ​ Symbolische Uitwisseling ​ moet worden overgegaan en koordmanipulatie en het coderen vereist (Base64 gecodeerd en URL daarna gecodeerd) alvorens de vraag te maken.

Stap: "Is Adobe-token gegenereerd?" step9

TIP
Uiteinde: voer dit door het middel van de Authentificatie van Adobe Pass ​ Symbolische Uitwisseling ​ succesvolle reactie uit, die a 204 No Content zal zijn, erop wijzend dat het teken met succes werd gecreeerd en klaar is om voor de vergunningsstromen te worden gebruikt.

Stap: "Reguliere verificatieworkflow starten" step10

TIP
Uiteinde: voer dit door het middel van het 2} Verzoek van de Code van de Authentificatie van Adobe Pass ​ uit, ​ initieer Authentificatie ​ en ​ wint het Symbolische van de Authentificatie ​ of ​ Symbolische van de Authentificatie van de Controle ​ API diensten terug.
TIP
ProUiteinde: volg de stappen hieronder voor de implementatie/s tvOS.
TIP
ProTip: volg de stappen hieronder voor de implementatie/s iOS/iPadOS.

Stap: "Doorgaan met vergunningsstromen" step11

TIP
Uiteinde: voer dit door het middel van de Authentificatie van Adobe Pass ​ in werking stelt Vergunning ​ en ​ verkrijgt de Korte Token van Media ​ API diensten.

Afmelden apple-sso-cookbook-rest-api-v1-logout

Het ​ Video Kader van de Rekening van de Abonnee van de Abonnee ​ verstrekt geen API aan programmatically logout mensen die binnen aan hun de leveranciersrekening van TV op het niveau van het apparatensysteem hebben ondertekend. Daarom moet de eindgebruiker zich expliciet afmelden bij Settings -> TV Provider op iOS/iPadOS of Settings -> Accounts -> TV Provider op tvOS, anders wordt de aanmelding niet volledig van kracht. De andere mogelijkheid die de gebruiker zou hebben, is het intrekken van de machtiging om de abonnementsgegevens van de gebruiker te openen in het gedeelte met specifieke toepassingsinstellingen (toegang tot tv-provider).

TIP
Uiteinde: voer dit door het middel van de Authentificatie van Adobe Pass ​ de Vraag van de Metagegevens van de Gebruiker ​ en ​ Logout ​ API diensten uit.
TIP
ProUiteinde: volg de stappen hieronder voor de implementatie/s tvOS.
TIP
ProTip: volg de stappen hieronder voor de implementatie/s iOS/iPadOS.
recommendation-more-help
3f5e655c-af63-48cc-9769-2b6803cc5f4b