ViktoriaSl / simple-add-on

0 stars 0 forks source link

Can not authenticate to my instance #1

Open ZioHimself opened 7 years ago

ZioHimself commented 7 years ago

Environment:

<To Be Elaborated On>

For example:

having:

Scenario (Steps to reproduce):

<To Be Elaborated On>

For example:

  1. checkout project
  2. run sbt -Dconfig.file=conf/development-h2.conf run
  3. navigate to http://localhost:9000
  4. run ngrok http 9000
  5. copy the https url produced by the ngrok command (should look like https://b311d1d8.ngrok.io)
  6. login into https://exalatedevserhiy.atlassian.net with: 1.1 username: admin 1.2 password: admin
  7. navigate to https://exalatedevserhiy.atlassian.net/plugins/servlet/upm
  8. click Settings
  9. tick the Enable development mode option
  10. click Apply
  11. click Upload add-on
  12. paste the previously copied ngrok url https://b311d1d8.ngrok.io as value to the From this URL input
  13. click Upload
  14. navigate to http://localhost:9000/poller

Expected:

(Simplified version): the request is successfully authenticated (Full version): <To Be Elaborated On>

Actual:

<To Be Elaborated On>

ZioHimself commented 7 years ago

Hello, @ViktoriaSl , could I ask you to replace the <To Be Elaborated On> with actual info? Regards, Serhiy.

ViktoriaSl commented 7 years ago

Hello @ZioHimself!

Environment:

having:

Scenario (Steps to reproduce):

  1. run sbt run
  2. navigate to http://localhost:9000
  3. run ngrok http 9000
  4. copy the https url produced by the ngrok command https://5b47c2bf.ngrok.io
  5. login into https://simple-add-on.atlassian.net with: 5.1 username: admin 5.2 password: admin123
  6. https://simple-add-on.atlassian.net/plugins/servlet/upm
  7. click Upload add-on
  8. paste the previously copied ngrok url https://5b47c2bf.ngrok.io as value to the From this URL input like 'https://5b47c2bf.ngrok.io/atlassian-connect.json'
  9. go to https://simple-add-on.atlassian.net/browse/SIM-3
  10. click 'Admin', 10.1 click 'add field', 10.2 choose 'positive number' 10.3 fill field 'Edit positive number for SIM-3' with value '5'

Expected:

(Simplified version): the request is successfully authenticated (Full version): add-on validates input request and prints 'Correct number!' result in web panel 'Number Field Validation Panel'

Actual:

add-on validates input request and prints 'Error' result in web panel 'Number Field Validation Panel' service logs: [debug] application - Generated Jwt authorisation header: 'JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInFzaCI6IjFlNzBjYjc0ZjM4NWZkN2QzYjg0YTRhODIwMDc1MDFjZTNjZmZjYmYwODU5NTVmNzY1NmJiY2FmZThiYTAxZDkiLCJpc3MiOiJfYWRkLW9uX2tleSIsImV4cCI6MTQ4Mj E3ODQ2NywiaWF0IjoxNDgyMTc4Mjg3fQ.B2L3hycHxu4JlSOWPm0JDXllGWTlS8ztLUbTN4nXz7Y' [info] application - Error response from JIRA. Status code: 401. Status text: Unauthorized. Body:

ZioHimself commented 7 years ago

Hello Again, Viktoria. Thanks for the elaborate answer, I'm afraid I'm facing the troubles even at step 1 Just to be sure, did you have to resolve any dependency problems?

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.sbt#sbt-twirl;1.0.2: not found
[warn]  :: com.typesafe.sbt#sbt-native-packager;0.7.4: not found
[warn]  :: com.typesafe.sbt#sbt-js-engine;1.0.1: not found
[warn]  :: com.typesafe.sbt#sbt-webdriver;1.0.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

I'll try to fix that by feeding other versions. Regards, Serhiy.

ViktoriaSl commented 7 years ago

Hello @ZioHimself ! No, I don't have problems like this... I will clean /.ivy2/cache at my windows profile just to make sure that everything is correct and than I write you about the results

ZioHimself commented 7 years ago

I've just attempted to validate manually the token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInFzaCI6IjFlNzBjYjc0ZjM4NWZkN2QzYjg0YTRhODIwMDc1MDFjZTNjZmZjYmYwODU5NTVmNzY1NmJiY2FmZThiYTAxZDkiLCJpc3MiOiJfYWRkLW9uX2tleSIsImV4cCI6MTQ4MjE3ODQ2NywiaWF0IjoxNDgyMTc4Mjg3fQ image And it seems, that ac-connect framework generates the wrong issuer for your jwt token: "iss":"_add-on_key" while your add-on's key in https://github.com/ViktoriaSl/simple-add-on/blob/master/atlassian-connect.json is "field-validation-addon"

But I would not claim this to be the root cause of the problem though, it would be nice to have a good way to reproduce the issue on our environment.