Skip to content

Commit 935f7a3

Browse files
committed
docs: update readme on setting up apple config
1 parent f4f5062 commit 935f7a3

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The default group to assign all new users to.
168168

169169
### External Authentication Providers
170170

171-
We support `azure`, `bitbucket`, `github`, `gitlab`, `facebook`, and `google` for external authentication.
171+
We support `azure`, `bitbucket`, `github`, `gitlab`, `facebook`, `twitter`, `apple` and `google` for external authentication.
172172
Use the names as the keys underneath `external` to configure each separately.
173173

174174
```properties
@@ -199,6 +199,38 @@ The URI a OAuth2 provider will redirect to with the `code` and `state` values.
199199

200200
The base URL used for constructing the URLs to request authorization and access tokens. Used by `gitlab` only. Defaults to `https://gitlab.com`.
201201

202+
#### Apple OAuth
203+
204+
To try out external authentication with Apple locally, you will need to do the following:
205+
1. Remap localhost to \<my_custom_dns \> in your `/etc/hosts` config.
206+
2. Configure gotrue to serve HTTPS traffic over localhost by replacing `ListenAndServe` in [api.go](api/api.go) with:
207+
```
208+
func (a *API) ListenAndServe(hostAndPort string) {
209+
log := logrus.WithField("component", "api")
210+
path, err := os.Getwd()
211+
if err != nil {
212+
log.Println(err)
213+
}
214+
server := &http.Server{
215+
Addr: hostAndPort,
216+
Handler: a.handler,
217+
}
218+
done := make(chan struct{})
219+
defer close(done)
220+
go func() {
221+
waitForTermination(log, done)
222+
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
223+
defer cancel()
224+
server.Shutdown(ctx)
225+
}()
226+
if err := server.ListenAndServeTLS("PATH_TO_CRT_FILE", "PATH_TO_KEY_FILE"); err != http.ErrServerClosed {
227+
log.WithError(err).Fatal("http server listen failed")
228+
}
229+
}
230+
```
231+
3. Generate the crt and key file. See [here](https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/) for more information.
232+
4. Generate the `GOTRUE_EXTERNAL_APPLE_SECRET` by following this [post](https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003)!
233+
202234
### E-Mail
203235

204236
Sending email is not required, but highly recommended for password recovery.

0 commit comments

Comments
 (0)