Giter Club home page Giter Club logo

local-signin-with-apple's Introduction

Sign-In with Apple in your local developer environment

Sign-In with Apple is an awesome feature that can provide trust to your users as well as convenience. Unfortuantely, Apple doesn't allow using localhost as a callback URL.

There are workarounds for this, as you can read about in my blog post here. This script automates the process of setting up these workarounds.

In a nutshell:

  • Generates a self-signed certificate (.pfx, .crt, .pem, and .key) with an address you can use for testing locally (e.g. local-apple-signin.mydomain.com)
  • Imports and trusts the certificate
  • Adds a hosts file entry for the address

It places the certificate in a folder called .applesignin in your user profile, so all you need to do after running the script is configure your application to use it.

Prerequisites

The script has the following prerequisites:

Usage

It turns all the steps above into a one-liner:

./Generate-LocalCert.ps1

This will use a default URL and will generate a certificate password for you, but these can be supplied as arguments too:

./Generate-LocalCert.ps1 -url local.apple-signin.mydomain.com -certPassword myC00lp@55w%rd

With this simple script, you can solve all the pain of developing locally for Sign-In with Apple into a trivial one-liner.

Other requirements

The script needs to be run with root or administrator privileges (this is required for writing to the hosts file and importing the certificate into the trusted root CA store).

Note that some anti-malware programs will block both writing to the hosts file and importing certificates, so you may need to disable this while you run the script.

local-signin-with-apple's People

Contributors

matt-goldman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

local-signin-with-apple's Issues

๐Ÿ› Emojis causing encoding issues on Windows

Emojis are not being encoded correctly on Windows and prevent the script from running โ˜น๏ธ
In some places quotation characters are added which causes a mismatch on parentheses

image
Figure: Improperly encoded emoji character in source code

image
Figure: Error when attempting to run the script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.