AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Swift share through facebook12/21/2023 Now, in the AppDelegate, add the following method: Under URL Types, click the + button to add a new URL Type. To do so, open the Stormpath Notes project file, click on the Info tab, and scroll down. Just like how links with get opened with Safari, we can register a custom URL scheme to do so for Stormpath Notes. To integrate social login, Facebook and Google assign us custom URL schemes, so their login page can redirect back to our app. However, since this is for our test app, we already have App IDs you can utilize for sign in. When integrating social login for your own app, you’ll have to register an app on Facebook or Google’s developer website, and set that up. In our iOS SDK, we’ve simplified Facebook and Google Login so integration is just one line of code! The Facebook and Google SDKs are very feature-rich, but overkill when you just want to log in. With Stormpath, we’ve made it really easy to add social login with Facebook and Google. There we go! If you now run and try out your app again, you’ll find that you can now register users, log in, and save your notes! Add Facebook and Google Login In this case, we are using the default of email, password, givenName, and surname: Depending on the configuration in your backend, you may require different fields for registration. In register(_:), we need to create a RegistrationModel, which represents the registration form for the user. Let’s start writing some code so that we can register a user. Looking through the file, you’ll notice a function called register:, which will be run whenever someone presses the register button in the app. Now that we have the Stormpath SDK embedded in your Xcode project, let’s add it to your RegisterViewController so that users can sign up for an account!Īs earlier, we need to add import Stormpath to the top of the file so you can use the Stormpath SDK. You can get rid of the error by pressing ⌘-B to rebuild your project. Note: Xcode may not recognize the import Stormpath command after installing it via Cocoapods. This will configure your application to use our API server for Stormpath. POST /notes – takes a JSON object with the notes and saves it for the authenticated user. GET /notes – returns the notes for the authenticated user in the form of a JSON object. This allows your backend developers to protect additional endpoints with Stormpath authentication.įor Stormpath Notes’ backend, I’ve exposed and protected these endpoints: Stormpath’s backend integrations expose a common API for mobile clients to connect to, which we’ll use the iOS SDK for. If you want to learn how to build this backend, I’ve written a tutorial on building the Stormpath Notes Backend with Node.js. I’ve already built and hosted the backend at, so we will take the perspective of an iOS developer using the Stormpath SDK to build against this backend. This tutorial is for an iOS app in Swift, but you can also try out our Android tutorial! To show what you can do with Stormpath, we’re building Stormpath Notes, a simple note-taking application that allows a person to log in, edit, and save their personal notes on a server. Today, we announced support for iOS and Android, and this post will walk you setting up a basic Swift app with user login, with some technical discussion along the way. Integrating a secure user datastore into your app can now take less than 15 minutes. Stormpath is a complete solution designed to plug into your backend and mobile apps, and securely manage your users and authentication. In a world where security and privacy matters heavily to the average user, what can we do?įortunately, we built Stormpath to solve this problem. Unfortunately (and embarrassingly, as many of us mobile developers know), teams often ship apps with weak security in the name of speed. With so many problems to be working on, why spend hours or even days working with your team to implement your authentication system, of all things? When building mobile apps, authentication is usually the last thing you and your team want to think about. For an updated version of this article, see Build an iOS App with Secure Authentication in 20 Minutes on the Okta developer blog.
0 Comments
Read More
Leave a Reply. |