How to customize the Mac OSX login? - macos

I need to customize the whole login screen and functionality for any Apple`s Macbook.
The general idea is to have control under the user credentials to authenticate this user on a external authentication server.
Thus, it's important to customize the UI, like adding a new TextField for a second password input or displaying a image like a QR Code.
What I have done so far
After digging some research, I`ve found out only two relevant projects:
1 - https://github.com/skycocker/NameAndPassword
However it is from 4 years ago and it seems outdated.
2 -
https://developer.apple.com/library/content/samplecode/PreLoginAgents/Introduction/Intro.html
And I've deployed the sample code for the PreLoginAgent from Apple, however it only opens an external application on login.
What I'm looking for
What is the most appropriated way to handle a customization inside the Mac OSX authentication?
Note: I'm looking for a solution where I can avoid breaking out the login as well.

I'm not sure why you discount your first link (NameAndPassword)
It's a "fixed" version of one of Apple's sample projects for SFAuthorizationPluginView. That is the class you need to use. Unfortunately as you see by Apple's own sample not compiling, and the very thin documentation, it might be tricky to get it working.
However, I took the project from the link above and compiled it on my machine.
Then I copied the resulting .bundle to /Library/Security/SecurityAgentPlugins
Next you need to register the plugin in the authorization database:
security authorizationdb read system.login.console > outfile.plist
Modify the outfileplist by replacing:
<string>loginwindow:login</string>
with:
<string>NameAndPassword:invoke</string>
Now, update the database:
security authorizationdb write system.login.console < outfile.plist
Now, log out and the login screen will reflect the custom view.
Once installed, the link you provided is a good simple PoC. If you need additional help in customising your SFAuthorizationPluginView to do what you want, I suggest you post specific questions around that.
Just because the API is older does not mean it's out of date. The login screen has not changed a lot over the years. As for the out-of-date samples and poor documentation, that seems fairly typical of these more esoteric macOS developer features.
Useful links:
Customize Login Screen Mac OSX (SFAuthorizationPluginView)
Custom login/lock screen in OS X Mavericks
https://developer.apple.com/documentation/securityinterface/sfauthorizationpluginview

Related

Is there anyway to integrate facebook into a Unity desktop application?

I'm developing a Unity's cross-platform application (Win, macOS, Android, iOs) and I wanted to include a facebook login so users could sign up via Facebook. I've already been able to do it in Android and iOS platforms through the following link:
https://developers.facebook.com/docs/unity/gettingstarted
This method doesn't work for standalone desktop platforms. I've been looking for a solution to the problem, but I haven't found anything.
Does anyone know a solution or a plugin for Unity that can include Facebook Login for Desktop Standalone platforms?
Facebook still does not have any way to use its official SDK in Standalone builds (it's 2019 now, and posts requesting that feature can be seen dated as far as 2013...)
The options (as of now) are:
1. Manually build Facebook login flow
(that requires server-side support and opening a webpage outside of Unity) - see here:
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/
Pros:
Cheapest option if you can self-host executables
Good start option
Some major gamedev companies went for such solution (even Blizzard!)
Cons:
You will need to minimalize Unity game to log-in
Requires some time to code and test properly
Note:
Tested in one of my own games;
2. Use third-party provider
(like Google's Firebase)
Pros:
You have it up and running in matter of minutes
You can integrate other login methods
Cons:
You are locked in with that provider
It costs you on per-user base
Note:
Also tested in some other of my games;
There are several urban legends that Firebase is way more costly then it promises; See here ("How we spent 30k USD in Firebase in less than 72 hours") and here ("Unexpected monthly bill of more than 1.000€")
3. Embed Chromium directly into Unity, use in-browser authentication
You will need either free and open software chromium framework (here or here), or if you need premium support - this plugin.
Then you must follow this tutorial:
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/
But this time - using embedded browser, which does not requires external server.
Pros:
No recurring paymants
Does not take your users away from your game
Cons:
This is treated as new browser for user; Cookies, stored session, etc. will not be available
Let me stress that out again: users will have to explicitly login to Facebook, without their favorite password managers
Still need some time to code and test propertly
Note:
I did NOT throughtly tested that. Use at your own risk - I would actually recomend either 1. or 2.

How I apply review to get publish_actions permission for a Windows application written in Win API/C++?

I created and used application softwares(exe file written in C++ with Win SDK) of Windows OS(Win7) which has a function to upload(post) user photos to Facebook. They were working fine but now it is not possible to post photos to Facebook and I got to know I need get my application reviewd for public_actions permission. I tried to do it but could not find way to submit since there's no category for Windows application. How can I do it? I think the reviewers need to 'run' the app and it looks OK for andriod, iOS, Win8 apps, and Web site since reviewers can access to them by codes or URL for the apps but I have no idea how to make it for my Windows application. It is big size application with lots of images over 1Gbytes. Will it be OK to use an FTP account for the reviewers to download and review it?
In your review notes you can explicitly mention that this is a Windows application. You will need to provide as much screenshots as possible or preferably, a screencast where you show how you use the Facebook integration.
To get all the required fields, you can fill in the website for your application (if you have one) or an other website. Just make sure to mention that in your reviewer notes.
That should work with getting your app reviews.
ps: this question actually is not appropriate for Stackoverflow. I suggested using the Facebook Developer Community group for these kind of questions (non-technical).

How can I make unlimited windows using Xcode when developing a Mac app?

I am trying to develop an application for the mac however I am having issues trying to make multiple windows such as when you click cmd+N on safari.
I have tried looking for tutorials on how to do it however the closest I have got to be able to do this is just by creating a separate window by using this tutorial here: https://www.youtube.com/watch?v=Z1Erw7aP0EQ
If anyone knows how I can make unlimited windows using Xcode I will highly appreciate it!
Just write a NSDocument-based app, as described in Apple's docs. BTW, Apple's docs are always worth visiting together with the various tutorials you can dig up with Google.
That said, the document architecture works best if your window is going to contain something that can be viewed as a document. If the Open... (and maybe Save...) menu items make sense for your data, then you'll likely be fine with the document architecture, otherwise you should be prepared to jump through a few hoops to tweak the architecture to your needs.

Chrome Portable on read only device: Suppress read only warning

I'm making a windows app for a client using Chrome in kiosk mode. They'd like to burn the project to CD. While this works fine with chrome portable on a read access device it doesn't with a read only device. A warning pops up asking to temporarily copy it to the local drive to run from there. Clicking yes allows the program to work but i'd like to suppress this as they won't want to see it every time. Is there a way for me suppress the warning or cache to the cd before it's burned?
I need to use chrome, not another portable browser. I could be being naive and they're may be a better option than using Portable apps chrome download.
I asked the same question on the Portable apps website and got this response. It worked great although take note of the distribution license.
Add a text file called GoogleChromePortable.ini in your GoogleChromePortable folder that says
[GoogleChromePortable]
RunLocally=true
this will make it copy the profile to the temp folder on the computer and run from there whether it's in read only place or not.
also notice Johns reminder in Pyromaniac's thread (http://portableapps.com/node/37168#comment-207403) - giving someone, especially a "customer" a copy of Google Chrome, Portable or otherwise, is illegal, don't do it.
Link to forum
http://portableapps.com/node/37164#comment-207482
I've investigated the license agreement and found this
21.2 Subject to the Terms, and in addition to the license grant in Section 9, Google grants you a non-exclusive, non-transferable license to reproduce, distribute, install, and use Google Chrome solely on machines intended for use by your employees, officers, representatives, and agents in connection with your business entity, and provided that their use of Google Chrome will be subject to the Terms.
So legal as long as it's kept internal. Works great if anyone ever stumbles on this question. Chrome makes an awesome portabl app.
To get around user policies you can try a pretty software does what you want.
http://codecanyon.net/item/html5-2-desktop-app-converter/4527199
This uses chrome engine and creates kiosk like portable engine for your given URL or local files. It makes pages looking like windows application. Hope helps.
Note: I'm not the author :)
Here's a link to where I got something that worked for me.
In the Support section, there is a performance note that advices copying GoogleChromePortable.ini from the GoogleChromePortable\Other\Source directory to the GoogleChromePortable directory and editing it to set RunLocally=true in order to increase performance, well this sorts out the warning that pops up.
However take note of the privacy implications of doing this as also stated in the same section.
Hope this helps someone.
You could try Chromium (portable) which also includes chromedriver from chromium snapshots page. Pick one with the biggest number (scroll down):
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/

With coexisting legacy and modern Mac apps, can't associate bundled documents globally to the modern app(Launch Services?)

Updated 4-9-2013
This is a total repost of my earlier question. As I have learned much more about Launch Services, UTIs and the depreciated creator codes, I feel I can better ask the question from scratch.
Problem Description:
We have an application that was designed for Legacy Mac 9.xx which still runs on Snow Leopard(with Rosetta). The application uses bundled files We developed our new app for Snow Leopard and beyond. The issue is that Launch Services does not properly associate the new app based on the plist configuration we are currently using and I need to know what I am doing wrong.
If I right click on the bundled document and select GetInfo, I can associate the bundled file to either the legacy app or the new app and it will work as I expect it to. I believe that is because snow Leopard still used the Creator Code technology for this type of association. If I tell the file to associate itself with the old legacy app and I press "Change All" , Launch Services will correctly associate all files of that type and it will work as expected. If I tell the file to associate itself to the new App and I select "Change All", The app will open but the files will not. From what I can tell, Launch services is assigning a dynamic UTI to the app and it when the file is clicked on, The OS doesn't know what app to use.
I found a couple of posts out there that seem to suggest Apple might have made some design mistakes in the new UTI methodology. One post here shows how to add an array of string file extensions to the ExportedUTIs dictionary of the new apps pList. This gets the app to function correctly, but that is not going to solve the problem; If we allow our users to name their files anything, we cant predict in an array what their file extension is going to be. We need Launch Services to operate correctly strictly with the UTI code, or some how get the OSType code to work.
Post about UTI's
Once the new app decides it can't open it's related file, I have to open the LanchServices.plist, delete the entry and restart the lsregister database. Then I can once again open a file with the new app(by associating it without pressing "Change All").
I am attaching some images to the app plists , the bundled document plist and the Launch Services entry:
Any help and our guidance is much appreciated.
Mike
Updated : 4/16/2013
The link to the post about UTI's I provided also includes a link to an open source software app called RCDefault app. This app will associate your APP to the given file based on your choice of UTI's , file extensions, OSType codes, and file types. Strangely, this app is able to associate the file to the app based on the UTI's structure that is provided in our plists.
Is it possible this is all just a bug in Launch Services for Snow Leopard for this specific scenario and Apple has chosen to just ignore it at this point(considering they no longer support Snow)?
You're missing your CFBundleTypeExtensions. Create a CFBundleTypeExtensions of type Array, and Item 0 should be your file extension.
You're also missing your CFBundleTypeName, which is the alias type that the file will use. Makes it nice and pretty. :)
Reference (CFBundleDocumentTypes): https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
Its been awhile since I originally posted this, but just in case this is interesting to anyone else I have made some additional discoveries:
This problem doesn't have much to do with trying to be compatible with a legacy app and an OSX app. The bundled file contains a creator code and an OSType code. As long as these two items exist in the legacy apps plist it will open when ever it is asked to, globally or individually.
The problem appears to be trying to include the ostype code in the newer apps plist as an equivalent type under Exported type UTI's.
The only solution that appears to work is to add the array of file name extensions
as an equivalent type as #Derek mentioned to begin with.
That is the only solution that solves this problem. Ironically this violates apples human interface guidelines which states to some degree that a user should not be forced into file extension restrictions.
It appears that UTI's only work on non bundled documents(files), which is also supported by a few posts out there that basically say apple really screwed this up. What is the point of worrying about UTIs if in the end you need the array of extensions anyway?

Resources