none
VSTS OAUTH API returns 400 Bad request RRS feed

  • Question

  • I am not able to connect to my VSTS account services through API, I am using OAUTH2 authentication which is failing. I tried with different scenarios noticing the errors I've received still it doesn't allow me to login even after providing all correct credentials

    Scenario 1: I was using the same credentials that I have been using since days to connect to my VSTS account and tried re authenticating it as my refresh token is frequently failing and all of a sudden it was not able to connect to my account, Initially i haven't got any error but I noticed that in url while getting the token it says invalid scope, I was curious as what happened as I haven't made any changes to my scope since days.

    So i've deleted my previous registered app as I need to use the same callbackUrI and started registering the new app and surprisingly it throws me scope errors saying scope code search and work item search cannot be used, I didn't even understand why this has happened and so I avoided those both scopes to see if I can then login and was able to register the app and get my credentials

    Scneario2: After registering the new app and using the creds I got i.e. APP ID, scope details and other related still it doesnt allow me to connect to my account and throws bad request 400 error, but all the details included in the url are correct as shown below:

    https://app.vssps.visualstudio.com/oauth2/authorize?scope=vso.build_execute+vso.code_full+vso.code_status+vso.connected_server+vso.dashboards+vso.dashboards_manage+vso.entitlements+vso.extension.data_write+vso.extension_manage+vso.gallery_acquire+vso.gallery_manage+vso.graph_manage+vso.identity_manage+vso.loadtest_write+vso.machinegroup_manage+vso.memberentitlementmanagement_write+vso.notification_diagnostics+vso.notification_manage+vso.packaging_manage+vso.profile_write+vso.project_manage+vso.release_manage+vso.security_manage+vso.serviceendpoint_manage+vso.symbols_manage+vso.taskgroups_manage+vso.test_write+vso.wiki+vso.work_full&response_type=code&redirect_uri=https%3A%2F%2FXXXXXXXXX&state=vsts&client_id=XXXXXXXXX

    ofcourse, I tried changing the response_type from code to Assertion still I get the same error and also tried replacing + signs with % although my app converts them during request
    Initially I haven't had any problem and it started all of a sudden when I am ready to deliver my work.

    I tried with postman, still I get the same error 
    https://XXXXX.visualstudio.com/
     I am not sure what has happened or if I am doing anything wrong.

    Any help will be appreciated.
    I tried with all possibilities including interchanging the ID values, connecting through postman, curl request etc.

    Error I get is: 400 
    BAD REQUEST
    We didn't understand the syntax of the request
    Wednesday, July 11, 2018 2:59 AM

Answers

  • made a super silly mistake, just missed a symbol from redirect url and that caused this issue
    • Marked as answer by SaiCont Wednesday, July 11, 2018 3:36 AM
    Wednesday, July 11, 2018 3:35 AM