Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue with SmartPension #75

Closed
Frenchcooc opened this issue Jul 10, 2020 · 6 comments
Closed

Issue with SmartPension #75

Frenchcooc opened this issue Jul 10, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@Frenchcooc
Copy link
Contributor

This is a bug reported by @Hagbarth . I have not try to reproduce it yet. Just writing what he's shared with me

How to reproduce:

  1. Add thee SmartPension API with the following config:

    {
     "name": "SmartPension",
     "auth": {
         "authType": "OAUTH2",
         "bodyFormat": "json",
         "grantType": "authorization_code",
         "config": {
         "scope": ["customer"]
         },
         "tokenParams": {},
         "tokenURL": "https://id.autoenrolment.co.uk/oauth/token",
         "authorizationMethod": "body",
         "authorizationParams": {
         "responseType": "code"
         },
         "authorizationURL": "https://id.autoenrolment.co.uk/oauth/authorize"
     },
     "request": {
         "headers": {
         "Accept": "application/json",
         "User-Agent": "Pizzly",
         "Authorization": "Bearer ${auth.accessToken}"
         },
         "baseURL": "https://api.autoenrolment.co.uk"
     }
    }
    
  2. Create an OAuth application at SmartPension website (link)

  3. Configure the API in your Pizzly dashboard

  4. Try to connect

@Frenchcooc Frenchcooc added the bug Something isn't working label Jul 10, 2020
@Hagbarth
Copy link
Contributor

For context this is what I'm seeing:
ezgif-2-304885b853d8

As you can see, I'm taking no action in the popup before the error message appears.

@Hagbarth
Copy link
Contributor

Error from the console:

Error: Authorization failed. The response type is not supported
    js latest/dist/index.umd.min.js:1
connect:100:21
    <anonymous> https://pizzly.pento.fun/dashboard/smart-pension-dev/authentications/connect:100

@Frenchcooc
Copy link
Contributor Author

Hi @Hagbarth! I believe this issue comes from the fact that SmartPension consent screen uses postMessage to send event to the parent window. They probably use that in their own authentication scenario, but that interfers with Pizzly!

I've made changes in the PR #76 and have released a new version of pizzly-js (v0.2.6). Can you update your version and try again? This should work as expected now.

@joaodias
Copy link

joaodias commented Jul 10, 2020

Hi @Frenchcooc! I'm working with @Hagbarth on this. The response type is not supported error is gone 🙌

However, we now get a new error after the modal closes:

Authorization failed. The authorization modal sent an unsupported MessageEvent.

Do you have any thoughts on why this is happening?

@Frenchcooc
Copy link
Contributor Author

Frenchcooc commented Jul 11, 2020

Hi @joaodia! Thanks for reporting this issue. I've introduced a bug by fixing the previous issue... 🤦‍♂️ Latest PR #77 fix the bug and a new version of pizzly-js has been published (v0.2.7). I'm really sorry for the trouble caused here.

@joaodias
Copy link

joaodias commented Jul 11, 2020

@Frenchcooc no problem! Thanks for fixing so fast ⚡

I confirm it's fixed now 🙌

We can now close the issue :)

nango-repository-pusher bot pushed a commit that referenced this issue Oct 29, 2024
…sed on changes in NangoHQ/integration-templates@0848311 by Hassan_Wari. Commit message: feat(salesforce): add salesforce integrations (#75)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants