Authorization error in K2 for sharepoint app registration wizard

1.2k Views Asked by At

I am facing this issue while trying to configure K2 for Sharepoint App.

When I run the registrations wizard, it successfully configures the first two steps - OAuth Tokens and Claims. In 'Administrative OAuth Tokens' it redirects to azure and prompts for trust to the app. When I click on trust, it redirects to [server name]/Identity/token/Home/Error with 'User Not Authorized'. Also, when I expand the exception details tab, there is no information available there.

I captured the process from Registration wizard to the error page in fiddler and tried to decipher the flow of requests. Here is what I interpreted regarding the flow of requests

  1. When the user clicks on registration wizard, it first prompts for the k2 designer url.
  2. First the OAuth Tokens gets created then the Claims token gets created
  3. Then there is a request from the smart form to the k2 server on [server]/Identity/authorize/oauth/2 with resourceID etc.as parameters.
  4. I guess, on this, the k2 server queries the databasefor an existing token, and in my case doesnt find it.
  5. The callback function gets a 401 not found error.
  6. This leads to the callback process initiatiates a prompt for Azure Level trust for the app from the user.
  7. When I click on 'trust' in the app, the k2 server is hit with something like ["admin-authorization" = true] as parameter.
  8. I assume at this level the the refresh token gets stored in k2 server.

  9. Then call-back function sends a request to [server]/Identity/token/oauth/2 (where I guess, it queries for the token that has just been created)

  10. Then it redirected to [server]/Identity/Home/Error - with message that authorization not successful.

Earlier I had deleted a saved token at - [server]/Runtime/Runtime/Manage+OAuth+Tokens. It has not been regenerated yet, I think it will be generated once the registration wizard is able to run properly.

In the following chart, I think the issue pops up between the steps 13-18.

How do I resolve this Issue? Any Pointers regarding this would be great help.

0

There are 0 best solutions below