add backend support for Apple auth provider

It's a bit different from other OAuth providers and requires a
different set of options and a private key file.
This commit is contained in:
Dmitry Verkhoturov
2023-01-03 23:47:42 -06:00
committed by Umputun
parent d7e9be99f9
commit c1b3fba344
10 changed files with 77 additions and 18 deletions
+5 -1
View File
@@ -208,7 +208,11 @@ func (ah *AppleHandler) initPrivateKey() error {
if err != nil {
return err
}
ah.conf.publicKey = ah.conf.privateKey.(*ecdsa.PrivateKey).Public()
publicKey, ok := ah.conf.privateKey.(*ecdsa.PrivateKey)
if !ok {
return fmt.Errorf("provided private key is not ECDSA")
}
ah.conf.publicKey = publicKey.Public()
ah.conf.clientSecret, err = ah.createClientSecret()
if err != nil {
return err