I want to ask about the Deployment of Forge API by Azure.
I had done it through the resource from Learn Forge, and it seems to work smoothly on the local site, but when I try to publish it, Although it shows permission
after I sign in, it shows 400 error refused, how can I do this for this error?
This is typically caused by an incorrect callback URL for the 3-legged authentication workflow.
When you develop your application locally, you typically set the callback URL (both in your application's code and in https://forge.autodesk.com/myapps) to something like http://localhost:3000/api/forge/callback/oauth).
However, when you deploy your application to Azure, AWS, Heroku, or any other cloud hosting provider, the callback URL must be updated accordingly. For example, if you deploy your application as an Azure Web App, the callback URL could look something like https://my-cool-app.azurewebsites.net/api/forge/callback/oauth. And again, you'll have to change the URL both in https://forge.autodesk.com/myapps, and in your Azure Web App settings.
Related
I am trying to publish the Azure APIM developer portal - it is enabled for user/pass - authentication. We haven't customized it and are just trying to get it to work.
When I click publish and go to view the portal in a different browser I get the following message
"This is a home page of the Developer portal - an automatically generated, fully customizable website for publishing your API documentation where consumers can discover APIs, learn how to use them, request access, and try them out.
The content hasn't been published yet. You can do so in "Developer portal" section of your API Management Service in the Azure portal. Learn more."
When I go back to the Portal publish page, it resets to show "Publish" as if nothing has happened?
Are there any logs or anything I can test to get this to work?
BTW - the Legacy portal works 100%.
Thank you.
I have Created the APIM instance and added the HTTP Trigger API from Function App and published the developer portal by enabling the CORS option also.
Next, I have created the user and given all APIs Level access in the APIM Instance and opened both deprecated and legacy portal in different browser, logged in with the non-administrative user:
You can see logs of all activities in the Activity log of APIM Instance:
To see the Function App API imported in the APIM Instance, you have to add that API to the products subscribed by that user:
Published the developer portal again with new changes:
Activity Logs:
Result:
You can check each log activity from the Activity log to see complete details whether the operation publish or other is succeeded and how much time it took to complete.
I am developing a GAS app.
Im using clasp to develop locally. I managed to get the connection working in order to run functions locally.
This required to move the GAS project from the default one to a new dedicated project.
I had to set up a proper OAuth ID in order to get the credentials for clasp, as they show in their Documentation.
The issue now is that the previosuly working webb app deployment dont work anymore. I get the next error:
404:
The requested URL /scripts/<MyProjectId>:run was not found on this server.
error screenshot
I'm thinking the web app deployment needs a proper OAuth or some other configuration in the new GCProject, but i cant figure out what it is.
Thanks in advance for any help.
Is it possible to use the 3-legged OAuth token without having some type of web application? Can you run the redirect URI to a localhost page?
Yes, absolutely. When you define your application, create a callback url like https://localhost:3000/callback. Next, in your code create a local web server which listen port 3000 and wait for the callback.
I wrote an example here - run command:
node forge.js 3legged auto
It should start your browser, and return you the 3legged access_token.
The redirect URI can be set to localhost but you still do need some simple web application to run on the localhost.
If you're looking for inspiration, take a look at how the vscode-forge-tools support a 3-legged token workflow from within Visual Studio Code. It basically starts a temporary localhost server that waits for the callback from Forge: https://github.com/petrbroz/vscode-forge-tools/blob/develop/src/commands/authentication.ts#L15-L55
I have a web app published to Azure built in Visual Studio MVC. Many times after publishing updated files the app will fail when querying the database so it seems. For instance the home page will load fine but the app will crash when a link is selected that connects to my database. It is a MySQL database hosted remotely.
Here's the error for the deployed version:
I'm not sure how to interpret the error either and I've looked into enabling development mode in my app but as far as I can tell it is enabled.
Occasionally after a few restarts through Azure the app will start working fine and the app consistently works when I build and launch through Visual Studio. It leads me to believe this is an Azure issue conflicting with my data base setup.
It's making testing a real hassle and I don't have confidence the app/database will be up when I need it to.
Thank you for your help!
I think that you need to get the detailed error message to interpret the error.
To get the error message in azure, we can watch the diagnostic logs, about how to do this, we can refer to: Enable diagnostics logging for web apps in Azure App Service
We can also display the error message directly on browser. For example, if you are using ASP.NET core MVC, we can do as below:
Replace the below code of Startup class:
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
With:
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
When the error occurs again, we can see the error message at browser directly
I was watching the java quickstart video for the google drive API and in that video it is mentioned that when developing real time console application the login flow should be done by :
starting a web browser in the local machine.
opening the native browser and taking the user directly to the authorization link.
making the redirection link as the local host and then let the local server receive the code and then shut down the browser and continue with you app.
but i have no idea how to execute these steps any idea or guidance???
The tiny application on Java quickstart implements these steps. Use "urn:ietf:wg:oauth:2.0:oob" as your redirect URL.