From a724cc18c874ae3c7c57c794222f87675e1fb492 Mon Sep 17 00:00:00 2001
From: Patrick Radtke <patrick@cirrusidentity.com>
Date: Tue, 21 Aug 2018 13:28:55 -0700
Subject: [PATCH] Add template for Yahoo OIDC

---
 lib/ConfigTemplate.php | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/ConfigTemplate.php b/lib/ConfigTemplate.php
index 6f8b71d..ca55d18 100644
--- a/lib/ConfigTemplate.php
+++ b/lib/ConfigTemplate.php
@@ -23,4 +23,27 @@ class ConfigTemplate {
         // Improve log lines
         'label' => 'google'
     ];
+
+    const YahooOIDC = [
+        'authoauth2:OAuth2',
+        // *** Yahoo Endpoints ***
+        'urlAuthorize' => 'https://api.login.yahoo.com/oauth2/request_auth',
+        'urlAccessToken' => 'https://api.login.yahoo.com/oauth2/get_token',
+        'urlResourceOwnerDetails' => 'https://api.login.yahoo.com/openid/v1/userinfo',
+        'scopes' =>  array(
+            'openid',
+// Yahoo doesn't support standard OIDC claims, like email and profile
+//          'email',
+//          'profile',
+// Yahoo prefers the sdpp-w scope for getting acess to user's email, however it prompts user for write access. Leaving it
+// out makes things work fine IF you picked being able to edit private profile when creating your app
+//            'sdpp-w',
+        ),
+        'scopeSeparator' => ' ',
+        // Prefix attributes so we can use the standard oidc2name attributemap
+        'attributePrefix' => 'oidc.',
+
+        // Improve log lines
+        'label' => 'yahoo'
+    ];
 }
\ No newline at end of file
-- 
GitLab