I'm trying to use IBM App ID cloud sign in for my iOS application and when I add the Authorization Delegate it keeps saying "Type 'SigninDelegate' does not conform to protocol 'TokenResponseDelegate'", but the protocol stubs are in my class that do conform to the protocol?

What I've tried is to create my own protocol that uses the same functions and parameters but that didn't work.

This is what it looks like to inherit the protocol and the stubs that are required to use if I want to use the IBMCloudApp id sign in functionality.

import UIKit 
import IBMCloudAppID
import BMSCore

class SigninDelegate: AuthorizationDelegate { 

   func onAuthorizationSuccess(accessToken: AccessToken?, identityToken: IdentityToken?, refreshToken: RefreshToken?, response: Response?)

   func onAuthorizationFailure(error: AuthorizationError)


   func onAuthorizationCanceled(error: AuthorizationError) 

}

Inside the AuthorizationDelegate there's this

public protocol AuthorizationDelegate : TokenResponseDelegate {

    func onAuthorizationCanceled()
}

then inside the TokenResponseDelegate there's this

import Foundation
import BMSCore

public protocol TokenResponseDelegate {

    func onAuthorizationFailure(error: AuthorizationError)

    func onAuthorizationSuccess(accessToken: AccessToken?, identityToken: IdentityToken?, refreshToken: RefreshToken?, response:Response?)
}

The expected result is this should be working fine since I am implementing the necessary protocol stubs...

1 Answers

0
Gustavo Conde On

According to IBM docs your SigninDelegate should look something like this

import IBMCloudAppID

class delegate : AuthorizationDelegate {
    public func onAuthorizationSuccess(accessToken: AccessToken, identityToken: IdentityToken, response:Response?) {
        //User authenticated
    }

    public func onAuthorizationCanceled() {
        //Authentication cancelled by the user
    }

    public func onAuthorizationFailure(error: AuthorizationError) {
        //Exception occurred
    }
}

Unless you are using a different version