I have currently implemented the code into my app from https://github.com/mattleib/o365api-as-apponly-webapp
It all works when clicking sign up, Auth's the account properly and returns to the same Page and allows me to load the calendar events.
My issue is that i need this to be persistent across the entire app as my aim is to do the following.
Administrator on initial login and or app start up, Auth's the app to Office 365.
When a user logs in they have a link to a page that will display the calendar that is configured for the page, a Resource.
Im assuming i need to setup a token cache, but not sure where from the above code sample, the token is generated and returned. I think it is stored in this variable on postback, Request.Form["id_token"] but unsure on how to store this in a cache/make it available for the entire application.
I have seen some examples that use Session Token Caches but if i am correct, this will require re auth to offcie 365 for each and every user and not be an app wide auth.
Ive tried searching for some samples or any pointers but cant seem to find any.
Anyone able to point me in the right direction
Related
I have a web app (rest API) on azure, and I have a B2C setup that is securing it, requiring you to be signed in to access the API. This is good, as i wanted the API to be restricted to members. Basically, the entire web app requires authentication, and will prompt you for a sign in.
Heres the problem - my app has users (who have accounts) and clients (who do not have accounts). These clients might receive an email about a new appointment being set up with one of the users - this email should have one or more links/buttons (ie, a button to Confirm appointment, one to Decline, and one to request a reschdeule) and upon clicking this link I would like to update a field in my database via the rest api, so the USER knows the CLIENT's response. The trouble is, since the client wont have an account, I have no idea how I can give them a link they would be allowed to go to, and have the update happen.
I have tried to do a bunch of research - ive looked into AD external identities with a one time passcode - but i cant seem to find any info on how i would actually get this to work for my purposes.
Does anyone know how I might implement this in azure? Is there a way to call to azure form c# to generate a one time authentication that i can encode into a URL or something?
Any thoughts would be greatly appreciated.
Thanks!
You could do an anonymous authentication by using a magic link. The users account won’t even need to live in the directory. The link can be short lived, and potentially one time use. We call it id_token_hint or a magic link.
Sample here
https://github.com/azure-ad-b2c/samples/tree/master/policies/invite
And reference here
https://learn.microsoft.com/en-us/azure/active-directory-b2c/id-token-hint
Hi everyone I have a problem I wanna create app for generate account google drive with api google drive and I don't know how can I login with account from application not navigator C# windows form.
enter image description here
and how can i edit this credential with exist user
Try following these steps:
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins?view=aspnetcore-3.1
I have used those steps and worked perfectly for me. You don't have a choice than to be redirected to the Google authentication page.
After entering your Google credentials, you are redirected back to the your site.
My understanding is that you are trying to use Google Drive API from a console application. Or for that matter a fully desktop application.
Take one thing in consideration, if you don't use Service account you must let the user authenticate to google and allow your application to work in his/her behalf. There is no way around this.
What you can do is after the user has already signed in, is to save the tokens and refresh them whenever necessary.
Of course OAuth may be complicated, but you use the .NET library everything will be managed for you. And you can look at a real example in the .NET Drive Quickstart
I'm building a web app (c#, asp.net-core-mvc) for internal use in my company. Authentication is required through user Microsoft Accounts (either through Windows Authentication or Azure, both options are working).
The issue I'm having is that I have been asked to require password confirmation when executing certain actions.
I have looked in all the documentation I could find but have not been able to find anything about this use-case.
The one thing I have found out is that it's apparently impossible with Windows Authentication since you can't log someone out.
I have been able to prompt the login page by using return Challenge();, but it loops back on the login page when you login (or shows 401 error page if you cancel), and doesn't return anything I have been able to exploit.
With Azure it also loops right back to the login page.
It would in theory be possible through Azure authentication by logging the user out and then back in, but I haven't been able to send the user back to the right page with the right information after logging back in.
So if anyone has a solution I'm ready to try anything that uses Microsoft accounts (custom user accounts isn't really an option since it's an intranet application).
We have 3-4 ASP.Net MVC 5 applications for which we want to implement the solution of single sign on.
Our requirements are
Any user trying to access anyone of the application (any page)
and if he has not signed in into the same or another application in
the same browser should be re-directed to the login page.
If the login is successful till that application is running, the user
should not be asked the login credentials again.
If the user logs out from one application, he should log out from all other
applications
Things which may be useful while suggesting a solution.
Currently 2 applications are hosted on different domains. Other 2 applications are on subdomains
Though they are on the same server, one application can have access to database of other application but we would like to have a solution where in this direct access of db should not be required.
We would like to have a 5th application which will do the account management and also login and logout will be handled by this application
We are not just looking at a solution where authentication will be done by the identity server but we are also looking at the authorization wherein the identity server will authorize the level of access of requesting application.
Going ahead if this solution can help us take care of mobile devices as well as webservice based client access, it would be an added bonus.
We are using forms authentication in our application right now.
We have seen some examples on internet which but we seem to be lost on some or the other feature. Either we are going wrong somewhere or we are not looking in the right direction.
Hence we are looking for an answer. Appreciate your time to read this big question.
Thanks
The C# Facebook SDK host on github allows Windows Store apps to login to their account via the app and post e.g. statuses or app related content through the app, however there are still some concepts that I don't understand.
Firstly, is it only possible to perform facebook related tasks after I have logged in for the current session. Can I not login in once (say, when I first download an app) and then have the app retain my settings. Then, whenever I want to post some content via my app and can just do it straight away, instead of having to sign in again (in the same or another session)
I was hoping that in my app I would be able to login in via an option in the settings charm which would navigate to my HomePage.xaml, and then I would be able to save that login state for multiple sessions. Currently I have this first bit running (though not completely, I can login but that's it right now), but how would I/can I automatically post content in future sessions without having to log in again?
Secondly, many apps that integrate with Facebook apps, that allow the user to post data stored in their local app or web user account via the Facebook app counterpart. How is this performed?
Say I have a class MyDataClass which contains properties DataTitle, DataItem1 and DataItem2. I would want to be able to send this to my wall, and have it display as an ordinary post (examples for this sort of functionality include things like ask.fm and formspring.) Would I then even be able to store this data via my Facebook app, and be able to send it to the users friends should they wish?
I would appreciate it if someone could explain whether these things to me. I've been search for a couple of days now and haven't answered these bigger questions.
Facebook C# SDK can be used via NuGet or you can get library from GitHub. When any user logs in via Facebook, the login result returns "Access Token". It is unique among all the Facebook users. You can save that access token in individual user's LocalSetting. Local setting documentation can be found here. Local setting can be used in this way.
//create instance of local settings
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
// Create a setting
localSettings.Values["FB_Access_Token"] = "THIS_IS_DUMMY_ACCESS_TOKEN";
// Read data from a setting
var objFbAccessToken = localSettings.Values["FB_Access_Token"];
if (objFbAccessToken == null)
{
// No data
// Do relogin of Facebook and save new facebook token
}
else
{
// Access user's Facebook data with help of Facebook C# SDK and Access Token
}
// Delete a setting
localSettings.Values.Remove("objFbAccessToken");
See this for extending access token.
Get long live access token from Facebook