当前位置: 首页>>代码示例>>PHP>>正文


PHP GenericOAuth2ResourceOwner::configureOptions方法代码示例

本文整理汇总了PHP中HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth2ResourceOwner::configureOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP GenericOAuth2ResourceOwner::configureOptions方法的具体用法?PHP GenericOAuth2ResourceOwner::configureOptions怎么用?PHP GenericOAuth2ResourceOwner::configureOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth2ResourceOwner的用法示例。


在下文中一共展示了GenericOAuth2ResourceOwner::configureOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => '{base_url}/oauth2/authorize', 'access_token_url' => '{base_url}/oauth2/token', 'revoke_token_url' => '{base_url}/oauth2/revoke', 'infos_url' => '{base_url}/user'));
     $resolver->setRequired(array('base_url'));
     $normalizer = function (Options $options, $value) {
         return str_replace('{base_url}', $options['base_url'], $value);
     };
     $resolver->setNormalizers(array('authorization_url' => $normalizer, 'access_token_url' => $normalizer, 'revoke_token_url' => $normalizer, 'infos_url' => $normalizer));
 }
开发者ID:shurastik,项目名称:hwioauthbundle,代码行数:13,代码来源:FiwareResourceOwner.php

示例2: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://accounts.google.com/o/oauth2/auth', 'access_token_url' => 'https://accounts.google.com/o/oauth2/token', 'revoke_token_url' => 'https://accounts.google.com/o/oauth2/revoke', 'infos_url' => 'https://www.googleapis.com/oauth2/v1/userinfo', 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', 'access_type' => null, 'approval_prompt' => null, 'display' => null, 'hd' => null, 'login_hint' => null, 'prompt' => null, 'request_visible_actions' => null));
     if (method_exists($resolver, 'setDefined')) {
         $resolver->setAllowedValues('access_type', array('online', 'offline', null))->setAllowedValues('approval_prompt', array('force', 'auto', null))->setAllowedValues('display', array('page', 'popup', 'touch', 'wap', null))->setAllowedValues('login_hint', array('email address', 'sub', null))->setAllowedValues('prompt', array('consent', 'select_account', null));
     } else {
         $resolver->setAllowedValues(array('access_type' => array('online', 'offline', null), 'approval_prompt' => array('force', 'auto', null), 'display' => array('page', 'popup', 'touch', 'wap', null), 'login_hint' => array('email address', 'sub', null), 'prompt' => array('consent', 'select_account', null)));
     }
 }
开发者ID:destillat,项目名称:HWIOAuthBundle,代码行数:13,代码来源:GoogleResourceOwner.php

示例3: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setRequired('base_url');
     $resolver->setDefaults(array('authorization_url' => '{base_url}/admin/oauth/authorize', 'access_token_url' => '{base_url}/admin/oauth/access_token', 'infos_url' => '{base_url}/admin/shop.json', 'use_bearer_authorization' => false));
     $baseUrlNormalizer = function (Options $options, $value) {
         return strtr($value, ['{base_url}' => $options['base_url']]);
     };
     $resolver->setNormalizers(['authorization_url' => $baseUrlNormalizer, 'access_token_url' => $baseUrlNormalizer, 'infos_url' => $baseUrlNormalizer]);
 }
开发者ID:emarref,项目名称:ShopiyOAuthBundle,代码行数:13,代码来源:ShopifyResourceOwner.php

示例4: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://www.facebook.com/v2.0/dialog/oauth', 'access_token_url' => 'https://graph.facebook.com/v2.0/oauth/access_token', 'revoke_token_url' => 'https://graph.facebook.com/v2.0/me/permissions', 'infos_url' => 'https://graph.facebook.com/v2.0/me', 'use_commas_in_scope' => true, 'display' => null, 'auth_type' => null, 'appsecret_proof' => false));
     // Symfony <2.6 BC
     if (method_exists($resolver, 'setDefined')) {
         $resolver->setAllowedValues('display', array('page', 'popup', 'touch', null))->setAllowedValues('auth_type', array('rerequest', null))->setAllowedTypes('appsecret_proof', 'bool');
     } else {
         $resolver->setAllowedValues(array('display' => array('page', 'popup', 'touch', null), 'auth_type' => array('rerequest', null), 'appsecret_proof' => array(true, false)));
     }
 }
开发者ID:jayesbe,项目名称:HWIOAuthBundle,代码行数:14,代码来源:FacebookResourceOwner.php

示例5: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://accounts.google.com/o/oauth2/auth', 'access_token_url' => 'https://accounts.google.com/o/oauth2/token', 'revoke_token_url' => 'https://accounts.google.com/o/oauth2/revoke', 'infos_url' => 'https://www.googleapis.com/youtube/v3/channels?part=id,snippet&mine=true', 'scope' => 'https://www.googleapis.com/auth/youtube.readonly', 'access_type' => null, 'approval_prompt' => null, 'display' => null, 'hd' => null, 'login_hint' => null, 'prompt' => null, 'request_visible_actions' => null));
     // Symfony <2.6 BC
     if (method_exists($resolver, 'setDefined')) {
         $resolver->setAllowedValues('access_type', array('online', 'offline', null))->setAllowedValues('approval_prompt', array('force', 'auto', null))->setAllowedValues('display', array('page', 'popup', 'touch', 'wap', null))->setAllowedValues('login_hint', array('email address', 'sub', null))->setAllowedValues('prompt', array(null, 'consent', 'select_account', null));
     } else {
         $resolver->setAllowedValues(array('access_type' => array('online', 'offline', null), 'approval_prompt' => array('force', 'auto', null), 'display' => array('page', 'popup', 'touch', 'wap', null), 'login_hint' => array('email address', 'sub', null), 'prompt' => array(null, 'consent', 'select_account', null)));
     }
 }
开发者ID:ismailbaskin,项目名称:HWIOAuthBundle,代码行数:14,代码来源:YoutubeResourceOwner.php

示例6: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://oauth.vk.com/authorize', 'access_token_url' => 'https://oauth.vk.com/access_token', 'infos_url' => 'https://api.vk.com/method/users.get', 'use_commas_in_scope' => true, 'fields' => 'nickname,photo_50', 'name_case' => null));
     $resolver->setNormalizers(array('fields' => function (Options $options, $value) {
         if (!$value) {
             return null;
         }
         return is_array($value) ? implode(',', $value) : $value;
     }));
 }
开发者ID:redkeet,项目名称:oauth-bundle,代码行数:14,代码来源:VkontakteResourceOwner.php

示例7: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://api.dailymotion.com/oauth/authorize', 'access_token_url' => 'https://api.dailymotion.com/oauth/token', 'infos_url' => 'https://api.dailymotion.com/me', 'display' => null));
     if (method_exists($resolver, 'setDefined')) {
         // @link http://www.dailymotion.com/doc/api/authentication.html#dialog-form-factors
         $resolver->setAllowedValues('display', array('page', 'popup', 'mobile', null));
     } else {
         $resolver->setAllowedValues(array('display' => array('page', 'popup', 'mobile', null)));
     }
 }
开发者ID:destillat,项目名称:HWIOAuthBundle,代码行数:14,代码来源:DailymotionResourceOwner.php

示例8: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('sandbox' => false, 'scope' => 'openid email', 'authorization_url' => 'https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize', 'access_token_url' => 'https://api.paypal.com/v1/identity/openidconnect/tokenservice', 'infos_url' => 'https://api.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid'));
     $resolver->addAllowedTypes(array('sandbox' => 'bool'));
     $sandboxTransformation = function (Options $options, $value) {
         if (!$options['sandbox']) {
             return $value;
         }
         return preg_replace('~\\.paypal\\.~', '.sandbox.paypal.', $value, 1);
     };
     $resolver->setNormalizers(array('authorization_url' => $sandboxTransformation, 'access_token_url' => $sandboxTransformation, 'infos_url' => $sandboxTransformation));
 }
开发者ID:senthilkumar3282,项目名称:HWIOAuthBundle,代码行数:16,代码来源:PaypalResourceOwner.php

示例9: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => '{base_url}/authorize', 'access_token_url' => '{base_url}/oauth/token', 'infos_url' => '{base_url}/userinfo'));
     $resolver->setRequired(array('base_url'));
     $normalizer = function (Options $options, $value) {
         return str_replace('{base_url}', $options['base_url'], $value);
     };
     // Symfony <2.6 BC
     if (method_exists($resolver, 'setNormalizer')) {
         $resolver->setNormalizer('authorization_url', $normalizer)->setNormalizer('access_token_url', $normalizer)->setNormalizer('infos_url', $normalizer);
     } else {
         $resolver->setNormalizers(array('authorization_url' => $normalizer, 'access_token_url' => $normalizer, 'infos_url' => $normalizer));
     }
 }
开发者ID:shurastik,项目名称:hwioauthbundle,代码行数:18,代码来源:Auth0ResourceOwner.php

示例10: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://oauth.vk.com/authorize', 'access_token_url' => 'https://oauth.vk.com/access_token', 'infos_url' => 'https://api.vk.com/method/users.get', 'scope' => 'email', 'use_commas_in_scope' => true, 'fields' => 'nickname,photo_medium,screen_name,email', 'name_case' => null));
     $fieldsNormalizer = function (Options $options, $value) {
         if (!$value) {
             return null;
         }
         return is_array($value) ? implode(',', $value) : $value;
     };
     // Symfony <2.6 BC
     if (method_exists($resolver, 'setNormalizer')) {
         $resolver->setNormalizer('fields', $fieldsNormalizer);
     } else {
         $resolver->setNormalizers(array('fields' => $fieldsNormalizer));
     }
 }
开发者ID:ismailbaskin,项目名称:HWIOAuthBundle,代码行数:20,代码来源:VkontakteResourceOwner.php

示例11: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('sandbox' => false, 'authorization_url' => 'https://login.salesforce.com/services/oauth2/authorize', 'access_token_url' => 'https://login.salesforce.com/services/oauth2/token', 'infos_url' => null, 'format' => 'json'));
     $sandboxTransformation = function (Options $options, $value) {
         if (!$options['sandbox']) {
             return $value;
         }
         return preg_replace('~login\\.~', 'test.', $value, 1);
     };
     // Symfony <2.6 BC
     if (method_exists($resolver, 'setNormalizer')) {
         $resolver->setNormalizer('authorization_url', $sandboxTransformation)->setNormalizer('access_token_url', $sandboxTransformation);
         $resolver->addAllowedTypes('sandbox', 'bool');
     } else {
         $resolver->setNormalizers(array('authorization_url' => $sandboxTransformation, 'access_token_url' => $sandboxTransformation));
         $resolver->addAllowedTypes(array('sandbox' => 'bool'));
     }
 }
开发者ID:raphydev,项目名称:onep,代码行数:22,代码来源:SalesforceResourceOwner.php

示例12: configureOptions

    /**
     * {@inheritDoc}
     */
    protected function configureOptions(OptionsResolverInterface $resolver)
    {
        parent::configureOptions($resolver);

        $resolver->setDefaults(array(
            'authorization_url'   => 'https://www.facebook.com/dialog/oauth',
            'access_token_url'    => 'https://graph.facebook.com/oauth/access_token',
            'revoke_token_url'    => 'https://graph.facebook.com/me/permissions',
            'infos_url'           => 'https://graph.facebook.com/me',

            'use_commas_in_scope' => true,

            'display'             => null,
        ));

        $resolver->setAllowedValues(array(
            // @link https://developers.facebook.com/docs/reference/dialogs/#display
            'display' => array('page', 'popup', 'touch'),
        ));
    }
开发者ID:xxspartan16,项目名称:BMS-Market,代码行数:23,代码来源:FacebookResourceOwner.php

示例13: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://www.box.com/api/oauth2/authorize', 'access_token_url' => 'https://www.box.com/api/oauth2/token', 'revoke_token_url' => 'https://www.box.com/api/oauth2/revoke', 'infos_url' => 'https://api.box.com/2.0/users/me'));
 }
开发者ID:michaeljayt,项目名称:HWIOAuthBundle,代码行数:8,代码来源:BoxResourceOwner.php

示例14: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolverInterface $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'http://www.odnoklassniki.ru/oauth/authorize', 'access_token_url' => 'http://api.odnoklassniki.ru/oauth/token.do', 'infos_url' => 'http://api.odnoklassniki.ru/fb.do?method=users.getCurrentUser', 'application_key' => null));
 }
开发者ID:destillat,项目名称:HWIOAuthBundle,代码行数:8,代码来源:OdnoklassnikiResourceOwner.php

示例15: configureOptions

 /**
  * {@inheritDoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('authorization_url' => 'https://login.live.com/oauth20_authorize.srf', 'access_token_url' => 'https://login.live.com/oauth20_token.srf', 'infos_url' => 'https://apis.live.net/v5.0/me'));
 }
开发者ID:ismailbaskin,项目名称:HWIOAuthBundle,代码行数:8,代码来源:WindowsLiveResourceOwner.php


注:本文中的HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth2ResourceOwner::configureOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。