ios - LinkedIn login with custom token ( ERROR_INVALID_CUSTOM_TOKEN ) -
i trying login linkedin using native app , linkedin sdk. far can login using web if linkedin app not installed. can login linkedin , token in return. when try authenticate firebase error:
optional(error domain=firautherrordomain code=17000 "the custom token format incorrect. please check documentation." userinfo= {nslocalizeddescription=the custom token format incorrect. please check documentation., error_name=error_invalid_custom_token})
this code:
// app installed let permissions = [lisdk_basic_profile_permission,lisdk_emailaddress_permission] lisdksessionmanager.createsession(withauth: permissions, state: nil, showgotoappstoredialog: true, successblock: { (returnstate) -> void in lisdkapihelper.sharedinstance().getrequest("https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,public-profile-url,industry,positions,location)?format=json", success: { (response) -> void in if let data = response?.data.data(using: string.encoding.utf8) { if let dictresponse = try? jsonserialization.jsonobject(with: data, options: .mutablecontainers){ let token = lisdksessionmanager.sharedinstance().session.accesstoken.accesstokenvalue auth.auth().signin(withcustomtoken: token! ) { (user, error) in print(user!) print(error!) } } } }, error: { (error) -> void in print("linkedin error\(string(describing: error))") }) }) { (error) -> void in print("error login linkedin") }
the token sending firebase string, should okay. must missing something. ?
the problem misunderstanding. thought use linkedin token directly. has go webservice uses firebase admin user generate token.
Comments
Post a Comment