We were using a .Net code to generation API token to access FMEServer in 2015 version, Which was working fine.
Recently we upgraded to FME Server 2019 tried accessing FME server with same source code which was using in FME Server 2015, was throwing an error as "No token was found for user id XXXXX". Could somebody help me to resolve the issue.
Also let us know what is the change in token id generation using FME Server 2019? Does we need to update our source code to generate Token with 2019 version?
Thanks in Advance!!!
Best answer by david_r
Looking at bit further, I see that the main problem is that you're calling the "view.json" endpoint, which seems to exist for looking up an existing token. This was probably not strictly enforced before, and I'm guessing that it would automatically generate a new token if no existing token was found. This seems to no longer be the case, and it now returns an error if no existing token is available.
You can simply fix this in your existing code by replacing "view.json" with "generate.json" in the URL. Then it should work with no further changes.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
I could reproduce the issue with FME Server 2020. It seems the way you're doing it with FME 2015 has either been deprecated, or was never really officially supported (it looks a bit weird to me, at least).
The good news is that it is relatively easy to fix the token request, here's an example that works for generating a token that's valid 1 day:
Two things to notice compared to your existing solution:
The URL is slightly different
The username, password, etc are sent in the message body, not as URL query strings
For reference, the Content-Type header is set to "application/x-www-form-urlencoded"
Looking at bit further, I see that the main problem is that you're calling the "view.json" endpoint, which seems to exist for looking up an existing token. This was probably not strictly enforced before, and I'm guessing that it would automatically generate a new token if no existing token was found. This seems to no longer be the case, and it now returns an error if no existing token is available.
You can simply fix this in your existing code by replacing "view.json" with "generate.json" in the URL. Then it should work with no further changes.
I could reproduce the issue with FME Server 2020. It seems the way you're doing it with FME 2015 has either been deprecated, or was never really officially supported (it looks a bit weird to me, at least).
The good news is that it is relatively easy to fix the token request, here's an example that works for generating a token that's valid 1 day:
Two things to notice compared to your existing solution:
The URL is slightly different
The username, password, etc are sent in the message body, not as URL query strings
For reference, the Content-Type header is set to "application/x-www-form-urlencoded"