Microsoft graph token refresh azure app service - asp.net

I have used this https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-1-Call-MSGraph,
but when I publish it to Azure I get an error after some time (probably 1 hour) with http error 500. It seems the token isn't refreshing automatically? When running the app locally it doesn't happen as often, but it have happened there as well. What can be done to fix this issue?
Redirect URIs are set as shown in the github example (https://websitename.azurewebsites.net/signin-oidc).

Related

Firebase adding web app doesn't work - err [Reason: Deleted account when looking up robot. AppIdentity::DELETED]

I have created an app in the testing project and all worked fine, now when I am trying to replicate it in the production project in Firebase, it's throwing the following error. I cannot seem to find anything related online. Any help would be appreciated. Thanks
error message
I am expecting to be able to add the web app into my project.
The Firebase support team has helped me to resolve this issue:
We need to override the bad OAuth client directly (the bad client may still exist, but will not be used for web apps anymore):
Create a new web OAuth client in Cloud Console with URIs and Authorized redirect specified (your project ID + firebaseapp.com)
In the Firebase console, Auth -> GoogleSignIn details -> Set the web client ID and secret from the new client
This worked for me.

Firebase Auth in Cross-Origin-Isolated mode?

I am working on a web app, which runs compute-intensive code using Emscripten's multithreaded WASM and therefore needs SharedArrayBuffers. Those only work if my app is in Cross-Origin-Isolated mode. And to enable that, I have to set the following headers on my app:
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Now, I would like to use Firebase in my project - first step is to integrate Firebase's Auth. Right now, I'm using firebaseui for handling the login flow. Unfortunately, that doesn't work and when I'm starting the login flow in my browser, I can see the following message in DevTools:
Apart from the error in the network tab, I don't get any indication that an error happened (i.e. no uncaught exceptions). Without the COOP/COEP headers, everything works fine.
Is there a way that I can use Firebase's Auth in Cross-Origin-Isolated mode?

Application Insights: only request failures appearing [duplicate]

I have a ASP.NET Web API controller that provides a saveAndNew operation.
This class is derived from System.Web.Http.ApiController as expected.
Application Insights is correctly configured using version 2.1.0 of the SDK and the default settings in ApplicationInsights.config.
If a request to the mentioned operation fails - for example with status code 400 - the request is recorded correctly in App Insights.
The problem is that if the operation SUCCEEDS (status code 200) nothing is recorded in Application Insights.
I've used Fiddler to see if the request is made to the App Insights track service and it is not. So the problem is not in the configuration of Application Insights on the Azure portal.
I can't figure out what is preventing ALL requests to my Web API controllers operations from being recorded.
Can anyone help?
You might want to try removing/commenting out TransferRequestHandler in ApplicationInsights.config file.
GitHub issue "REST API app can have all requests filtered out" here states that: "commenting out the one line in the ApplicationInsights.config caused successful requests to start getting logged. Web API 2 project.
<!--<Add>System.Web.Handlers.TransferRequestHandler</Add>-->

Application Insights tracking only failed ASP.NET MVC Web API requests

I have a ASP.NET Web API controller that provides a saveAndNew operation.
This class is derived from System.Web.Http.ApiController as expected.
Application Insights is correctly configured using version 2.1.0 of the SDK and the default settings in ApplicationInsights.config.
If a request to the mentioned operation fails - for example with status code 400 - the request is recorded correctly in App Insights.
The problem is that if the operation SUCCEEDS (status code 200) nothing is recorded in Application Insights.
I've used Fiddler to see if the request is made to the App Insights track service and it is not. So the problem is not in the configuration of Application Insights on the Azure portal.
I can't figure out what is preventing ALL requests to my Web API controllers operations from being recorded.
Can anyone help?
You might want to try removing/commenting out TransferRequestHandler in ApplicationInsights.config file.
GitHub issue "REST API app can have all requests filtered out" here states that: "commenting out the one line in the ApplicationInsights.config caused successful requests to start getting logged. Web API 2 project.
<!--<Add>System.Web.Handlers.TransferRequestHandler</Add>-->

Google Translate API authentication error

I am trying to call the Google Translate API and using the following to authenticate from my local - gcloud auth application-default login.
The command works successfully and I am authenticated but when I try to call the API i get the following error message which indicates that it is being read as an anonymous API call
google.cloud.exceptions.Forbidden: 403 Daily Limit Exceeded
I ran into this issue too this week,
I thought i was well authenticated but when i was running my code which is C# using the google translate API v2 package, it gave me the same 403 code daily limit exceeded,
I fiddled around with the CLI, made several accounts, service accounts API keys and all and it never worked.
https://cloud.google.com/dotnet/docs/getting-started/hello-world
this page, (the .NET guide part) says you should be using the google cloud platform plugin they release for visual studio, and login via that, i used it and it worked.
If you look on the bottom left part there are guides for any other language that you might be using. (consider adding that as info it helps me help you).
I would love it if it only worked via CLI but as long as it works i guess it's fine...

Resources