Hi guy's I just had a wonder moment I want to create an app for c# where users manage information I have read how to create authentication with windows azure ( which seems awesome ) but I was wondering how do apps link a user to their info i.e. when you log into treehouse you only get your Info , how do apps do this after authenticating the user just wondering any guidance would be helpful in c#
In Win8 apps, I believe you should be accessing data through IsolatedStorage which gives a unique store per user per assembly...
http://msdn.microsoft.com/en-us/library/System.IO.IsolatedStorage(v=vs.110).aspx
Related
I am working on two different Xamarin forms apps and there is a need where I want to share the SQLite database of first app with second app.
I want to achieve Single Sign On approach for different xamarin forms apps,
Where user will only log in in any of the app and can stay logged in in both the two apps.
I found below link which stats in android we can share the database:-
Share LocalDB in two different android app
now I only need is similar thing in my xamarin forms app.
Any help will be grateful.
Thanks :)
Enjoy!
In the case of iOS, it's sandboxed so sharing data between applications are so difficult. But there are still some ways to share data between applications.
In your case, I recommend you using App Groups. An App Group allows different applications (or an application and its extensions) to access a shared file storage location, please refer to Working with App Groups for more details.
After Adding an App to an App Group we can use the methods below to share data between applications:
NSUserDefaults:
var userDefaults = new NSUserDefaults("<your group ID>", NSUserDefaultsType.SuiteName);
userDefaults.SetString("user123", "userId");
userDefaults.Synchronize();
NSFileManager:
NSUrl appGroupDirectoryPath = NSFileManager.DefaultManager.GetContainerUrl("<your group Id>");
NSUrl dataBaseUrl = appGroupDirectoryPath.Append("dbName.db", false);
//You can try to copy your dataBase file to this url.
Yes it is possible to share the data between two iPhone apps ...
If anybody need more information on this please go through the below link which will explain how to achieve...
Using your App Group
App Groups are the scheme iOS uses to allow different apps to share data. If the apps have the right entitlements and proper provisioning, they can access a shared directory outside of their normal iOS sandbox. Sandboxing still applies except for a single exception.
This is probably almost automatic, but when you get into iOS app provisioning you can't assume anything. What's supposed to happen is that you just turn on the "app groups" entitlement in Xcode for the app and for any extensions..
Link for:-
Sharing the app extension
#Land Lu - MSFT Thanks for the suggestion your answer led me to get it done.
My company has an internal application where I need to pull/display pictures of all the employees from office 365 with out user intervention.
From what I read online I think I need to call Microsoft graph getphoto API in daemon application to achieve this as per this link (https://developer.microsoft.com/en-us/graph/docs/authorization/app_only).
Will this be a right approach? If yes please point me to any C# sample codes related to this.
Appreciate your responses.
Yes, this is exactly the type of application you will want to build. App-only (machine-to-machine) authentication should be used anytime you don't need a user present to execute functionality.
You can take a look at the ASP.NET Core App Only sample to get a sense of how to register and set up your app to use app-only authentication. The sample goes on to use this access token to set up webhooks, but you can replace this logic with your custom code. You will want to select the scope User.ReadBasic.All to have access to users' profile photos.
I need to know if is there any documentation on how I could add a custom user interface with a code written by me in C# to a credential provider done with pGina (http://pgina.org/) for Windows 10.
I have an application to make facial recognition done with Egmu CV in C# and in another side, I have developed a plugin with pGina to be used as a Windows Credential Provider, but I don't know how to join both things.
The problem I have is that all the documentation I have found on the web, is based on using the Windows user and password inputs interface, but I need to be able to show the webcam capture in the logon and unlock screens, authenticate the user using the app I've done, and if everything is right, authorize the user to access the computer. The KeyLemon app, has this feature, I need to know if it is possible to do it with pGina, to avoid the pain of creating all the CP code from scratch.
Any help will be really appreciated.
Thank you very much!!!!!!
I have multiple windows store apps of a company and all of them have signing in option. What I am trying to do is create a mutual login system for all of my apps. In simple words, If user log into one app then he automatically signed in other apps.
I am using sqlite locally to maintain user's session data. So, I tried to access the one App sqlite file from other app by giving a static path to its installed location. But it won't open the sqlite file.
Can I put this sqlite file in any folder where other apps can access it too?
Is there any common folder/storage space in windows store app where other apps will be able to access this sqlite file?
Any help would be really appreciated, Thanks in Advance!
Although it doesn't help right now, Windows 10 does have a solution for apps from the same publisher sharing data. You can use ApplicationData.GetPublisherCacheFolder(folderName) to get access to one or more folders that you share amongst your apps.
As far as I know there is no common storage between apps. The best you can do is to store the sqlite file somewhere locally (let the user choose) and then hold permission to access that file in the MostRecentlyUsedList
This will allow your app to access it at any time. However, the user will have to manually open the file at least once with each app that needs to use the login.
The only way I can think of to do what you're trying to do without user interaction would be to write your own server backend and use the IP address / user agent string and other variables to uniquely identify a device. When the device logs in then all other requests from that device would be considered "logged in" until the user logs out from one of them.
This would be very insecure and I would not recommend it. Anyone could impersonate the user if they knew enough about the device they were using, and were behind the same router.
I’m working on getting data sync happening for my Win8/WP8 app - written in XAML/C#. Periodically / or at app start up / suspend, I want to sync data files with the user’s OneDrive. To do that I need to get them to login to their Microsoft Live Account. I was looking to use Live SDK (v5.6) to do that.
Problem:
For users who have local Windows 8 accounts, the Live SDK lets me sign then in with a built-in credential prompt. This is working.
For users who have linked their Microsoft account with their Windows 8 account (and are logged in to Windows using their Microsoft account) the Live SDK lets me use single sign-on - and I have this working.
But I can’t call sign out, in order to sign in with a different Microsoft account.
1b is my problem. The built-in Windows Store app, lets users have a UX where they can use the MS account linked to their Windows account - OR - choose to use a different MS account. In effect: a ‘sign in as different user’ option. (See attached). It doesn’t look like it is technically single-sign-on in the built-in Windows store app, but that’s the UX I want - I don’t care so much for single sign-on, its a nice to have, but sign-in as a different user is a very important requirement.
What I’ve tried:
Lots of searching around. Found a bunch of people on the interwebs asking for the same thing. There are unanswered questions and even some ‘accepted’ answers on SO that don’t really work:
Sign in to multiple Microsoft account in Windows Store app
Windows Live SDK doesn't LogOut()
(incorrect answer)
Can the Windows 8 Live SDK use another Microsoft Account other than the current user? (incorrect answer)
I’ve forked the LiveSDK on Github (https://github.com/krishna-nadiminti/LiveSDK-for-Windows/commit/2cdb5408c0d8482c026cd96da6b99e4633677081) and tested it out - with and without requesting the ‘wl.signin’ scope - no good. It doesn’t have an option to change user.
Looked through the docs for WinRT - OnlineIdAuthenticator class, there is an option to always show CredentialPrompt when signing in users - but it does not allow the user to change the username if signed in via a linked account.
I looked through the built-in WinStore app’s js code and it uses some internal (native?) call to a ‘OMStub’ - which has methods to auth the user. This doesn’t seem to be part of the public JavaScript Live SDK
Question(s):
Are there Win32 / WinRT APIs that I could use to show credential prompts in a XAML app?
Can I use a WebView and auth users that way?
Should I just fall back to using the REST API and roll my own auth flow + UI for this?
How does the WinStore app do it?
Workarounds / Store certification:
For now, I’m a bit worried I only have the last option: roll my own .NET client over the Live connect REST API, and add my own UI for the credential prompt, and a user consent dialog which look exactly like the ones that the Windows Runtime provides. What will happen to store certification in that case? I can run it past WACK first - but the store app cert guidelines don’t talk about this: so unsure whether it will pass certification.
There is no mention of Microsoft account that I could find in the app certification guidelines.
The docs for Live SDK on MSDN explicitly mention that we’re not meant to create our own login UI: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh968445.aspx
However, the store app seems to violate this - may be because it doesn’t use the Live SDK at all.
There is also a MSDN article that says when the user signs in to Windows with a Microsoft account, sign out is just not possible from inside an app:
http://msdn.microsoft.com/en-us/library/windows/apps/jj193591.aspx#adding_user-authentication_functionality_to_your_windows_store_apps and that the only way is for the user to dissociate the Windows/Microsoft account or switch to a different user account.
Again - clearly this is not the case. The store app provides users a way to use a different account.
Help please?
You might want to look into the Web Authentication Broker: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn448945.aspx
It will invoke the actual Microsoft Account login flow but still give you the flexibility to sign out and back in as another user.