Invalid API access token for LinkedIn connection

I am trying to get an access token for doing authenticated LinkedIn API calls such as ones here :

What I am doing is :

                .scope("openid profile")
                .start {
                    switch $0 {
                    case .failure(let error):
                        // Handle the error
                        print("Error: \(error)")
                    case .success(let credentials):
                        // Do something with credentials e.g.: save them.
                        // Auth0 will automatically dismiss the hosted login page
                        print("Credentials: \(credentials)")
                        guard let accessToken = credentials.accessToken, let idToken = credentials.idToken else { return }
                        print("Access token is \(accessToken)")
                        print("Id token is \(idToken)")

But the access token I get is like : “-_KaLvqH6ofKJyywWdp5dwn2RfCNyI9z” which gives an invalid token error when used with LinkedIn API.
Anything i am missing here ?

1 Like