Code Monkey home page Code Monkey logo

fosoauthserverbundle's Introduction

fosoauthserverbundle's People

Contributors

adrienbrault avatar alanbem avatar arnaud-lb avatar bicpi avatar chapay avatar deguif avatar dinamic avatar dkarlovi avatar dnahrebecki avatar ghostika avatar gkfx avatar guilhemn avatar j0k3r avatar j4nr6n avatar kfuchs avatar leek avatar ludofleury avatar makasim avatar mkrauser avatar mtotheikle avatar ornj avatar pierredup avatar pulse00 avatar richardfullmer avatar schmittjoh avatar soullivaneuh avatar stof avatar vbardales avatar vlastv avatar willdurand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fosoauthserverbundle's Issues

Typo in the documentation

Hi Guys,

I've found a (small) typo in the Doc. (Resources/doc/extending_the_authorization_page.md)

In the sentence "The first step is to copy the authorize_content.html.twig template to the app/Resources/FOSOAuthServerBundle/view/Authorize/ directory."

The correct path is of course app/Resources/FOSOAuthServerBundle/views/Authorize/

Thanks for your awesome work.

I have the following error

=> Can't inherit abstract function OAuth2\Model\IOAuth2Client::getRedirectUris() (previously declared abstract in FOS\OAuthServerBundle\Model\ClientInterface) in C:\wamp\lib\Symfony\vendor\bundles\FOS\OAuthServerBundle\Model\ClientInterface.php on line 17

(version 1.1.0 for Symfony 2.0x)

Scopes configuration bug

The fos_oauth_server.service.options accepts only array of scalars. But the supported_scopes option as it defined in OAuth2 class should be array. So how to right configure supported scopes?

More tagged releases

Would be great to have more tagged releases for FOSOAuthServerBundle so that I can stick my project to a specific version using Composer.

Propel schema uses column name "user", which is incompatible with Postgresql

---insert-sql generates the following sql snippet:

´´´
CREATE TABLE token
(
id serial NOT NULL,
token VARCHAR NOT NULL,
expires_at INTEGER,
scope VARCHAR,
client_id INTEGER NOT NULL,
user TEXT,
class_key INTEGER,
PRIMARY KEY (id)
)
´´´
which Postgresql (Testable in phppgadmin) rejects:
´´´
ERROR: syntax error at or near "user"
LINE 8: user TEXT,
^
´´´
this is clearly based on the column name "user", as replacing it with "usr" works:
´´´
CREATE TABLE token
(
id serial NOT NULL,
token VARCHAR NOT NULL,
expires_at INTEGER,
scope VARCHAR,
client_id INTEGER NOT NULL,
usr TEXT,
class_key INTEGER,
PRIMARY KEY (id)
)
´´´
I expect the same to be true for auth_code as well ;-)

Disable authorization form

Hi,

Is it possible to disable the authorization form?
It does not make sense to have this form inside my own app.

Thanks!

Custom storage provider causes error when loading services

Hi there,

When setting a custom service for fos_oauth_server.service.storage an exception is thrown when the services are first loaded like so:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
The service definition "list_app.auth.oauth_storage" does not exist.  

the offending line seems to be line 78 of FOS/OAuthServerBundle/DependencyInjection/FOSOAuthServerExtension.php where it attempts to get the definition for the storage service. My service is definitely being defined as it shows up in the Symfony container:debug console command as the following:

list_app.auth.oauth_storage    container ListApp\AuthBundle\Storage\OAuthStorage

The relevant chunk of my config.yml looks like this:

service:
    user_provider:      fos_user.user_manager
    client_manager:     list_app.auth.client_manager
    storage:            list_app.auth.oauth_storage
    options:
        access_token_lifetime: 1209600

I am using the OAuth bundle in conjunction with the FOS user bundle and I need to set a custom storage as I need to take other details of a users account (such as active or suspended flags) in to consideration when fetching the from the DB. Am I approaching this correctly? Let me know if you need any more information.

Interestingly, this pull request #109 looks like it would help in my particular scenario as that is what I was after, but it still seems odd that it can't find my service.

Cheers.

Unlock this project

Hi FOS members,

Since 4 months ago, this project is definitely locked by @schmittjoh who started a refactoring of the whole. The problem is that you (Johannes) didn't provide any new commits since 4 months, and no guidelines or something else to move ahead.

So, I suggest we decide something there, there are a few Pull Requests, and people now want to use this bundle, and both @stof, and me often repeat the same sentence: "we have to wait the @schmittjoh's refactoring".

I don't have a lot of time these days, but I could (as well as some other people) try to give a hand to work on the refactoring, and to provide a stable bundle.

Regards,
William

"Client not found."

Hi,

I don't know if it's the good place for my issue, but I am lost and I don't find any help on Google...

In fact, I installed FOSOAuthServerBundle (With FOSUserBundle and FOSRestBundle). I can log in (oauth/v2/auth), but I have an error just after:
Screen Shot 2013-02-05 at 7 09 45 PM

As you can see, I am logged under "Sebastien". Maybe you have an idea how I can fix that?

Thank you.

Symfony 2.2 compatibility

Installing under symfony 2.2 causes an old version of the oauth2 library (1.0.2) to be installed.

(FriendsOfSymfony/oauth2-php#18)

Causes the following error:

Fatal error: Declaration of FOS\OAuthServerBundle\Storage\OAuthStorage::checkGrantExtension() must be compatible with OAuth2\IOAuth2GrantExtension::checkGrantExtension(OAuth2\IOAuth2Client $client, $uri, array $inputData, array $authHeaders) in /home/mmucklo/service/qvc/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Storage/OAuthStorage.php on line 33

AuthorizeForm doesn't bind if data is past via POST

If you send an authentication request via POST to /oauth/v2/auth endpoint the AuthorizeForm doesn't get populated because in AuthorizeFormHandler the form fails to bind expecting a CSRF token.

Maybe the form could be populated upon creation in the controller?

ClientInterface is too restrictive (problem with Propel)

I know this bundle is under heavy work right now; I'm just toying with it + Propel.

The FOS\OAuthServerBundle\Model\ClientInterface has typed arguments in method declarations:

function setRedirectUris(array $redirectUris);
function setAllowedGrantTypes(array $grantTypes);

When generating model classes with Propel, implementations in generated classes miss those types:

function setRedirectUris($redirectUris);
function setAllowedGrantTypes($grantTypes);

In that case, the classloader reports this error - Propel's implementation doesn't match its interface.
Is it ok to remove those types for compatibility's sake?

Or should I report this issue to propelorm?
(ping @willdurand )

Encrypted password grant

I'm working on a client-server application which makes use of a 2-legged authentication flow using the password grant-type. The only problem I have with this is the fact that the credentials are sent to the server unencrypted. What can I do to secure these credentials better? Thanks in advance!

Accessing api endpoint from the browser

We're working on a app where the API is used by a backbone.js client and native mobile clients. Right now our api endpoints can only be accessed through stateless firewall, when accessed by the browser by an authenticated user, we get OAuth2 authentication required.

However, we'd need to access the api endpoints from the browser as well, where the user is authenticated using cookie based authentication.

Is there a way to secure the API either by oauth2 or by the cookie authentication scheme?

Currently our firewalls in security.yml look like this:

    firewalls:
        api:
            pattern:    ^/api
            fos_oauth:  true
            stateless:  true

        webapp:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_provider: form.csrf_provider
            logout:       true
            anonymous:    true

        oauth_token:
            pattern:    ^/oauth/v2/token
            security:   false

        oauth_authorize:
            pattern:    ^/oauth/v2/auth
            form_login:
                provider: fos_userbundle
                check_path: /oauth/v2/auth_login_check
                login_path: /oauth/v2/auth_login
            anonymous: true

Documentation

Would be great if the docs were updated to include the latest configs

Declaration of Storage\OAuthStorage::checkGrantExtension() must be compatible with that of OAuth2\IOAuth2GrantExtension::checkGrantExtension()

When installing 1.2.2 I get:

Fatal error: Declaration of FOS\OAuthServerBundle\Storage\OAuthStorage::checkGrantExtension() must be compatible with that of OAuth2\IOAuth2GrantExtension::checkGrantExtension() in /Users/boy/Sites/Speakap/api/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Storage/OAuthStorage.php on line 33

Appearantly there is a use statement missing.

$client->getPublicId() != $token->getClientId()

In Model/Token.php, the line 33 as no sense :

<?php

public function getClientId()
{
    return $this->client->getPublicId();
}

It should be instead :

<?php

public function getClientId()
{
    return $this->client->getId();
}

In fact, I suppose this is because there's a bug in the file Oauth2.php of the FOS/oauth2-php repository:

Line 814 : $client->getId() != $token->getClientId()
Line 748 : $client->getPublicId() != $authCode->getClientId()

The line 748 should be $client->getId() and not $client->getPublicId().

Manage authorized scopes with a service

Authorized scopes can be defined in config.yml:

fos_oauth_server:
    service:
        options:
            supported_scopes: scope1 scope2 …

Is it possible to manage them with a custom service?
For examble:

fos_oauth_server:
    service:
        options:
            supported_scopes:
                id: my_authorized_scopes_service

My aim is to let bundles define the scopes they need.
my_authorized_scopes_service will lists all available scopes provided by bundles.

Password Grant requires secret, incorrect?

I'm using the password grant method however it was failing un-nessecarily in my opinion because the token request didn't pass in the client secret. It was my understanding that you shouldn't need to pass in the client secret when using this grant type?

If I comment out lines 685-687 in OAuth2.php then it works as expected (fails on incorrect credentials). However I imagine this will break other grant types.

My suggestion is that line 685 should be changed to:

if ($this->storage->checkClientCredentials($client, $clientCreds[1]) === FALSE && !self::GRANT_TYPE_USER_CREDENTIALS) {

But I'm fairly new to OAuth2 so please correct me if I'm wrong.

"findClientByPublicId" method of "fos_oauth_server.client_manager" service is not working

I was trying to use the bundle for basic authentification operations and it always created an exception : Client not found.
I modified the FOS\OAuthServerBundle\Controller\AuthorizeController line 133 in the getClient method :

before :

$client = $this->container
                ->get('fos_oauth_server.client_manager')
                ->findClientByPublicId($clientId);

after :

$client = $this->container
                ->get('fos_oauth_server.client_manager')
                ->findClientBy(array("id" => $clientId));

and now it's working !
did i miss something ?

Client registration

Would it be relevant to add client registration in this bundle since oauth2 require some fields to exist (redirect_uris, allowed_grant_types, id and secret) ?

Rate limits

Would this be something to be included in this bundle? Maybe I have time to develop it.

Bundle performance

I'm quite confused. By activating the bundle (with prod environment enabled), the response time increases from 150ms to 600ms. Have you noticed similar issues?

Proposal

First, thanks for this bundle.

What do you think about moving your bundle, and the oauth2 library to the FOS organization? Of course, that would also include adding you as a member.

I believe this bundle might be useful for many people, and deserves higher visibility.

What do you think?

cant get the authentication process in the Oauth server

hello,
I'm trying to create Oauth api server using FOSOauthServerBundle, FOSUserBundle and FOSRestBundle.
I followd the instructions on http://blog.logicexception.com/2012/04/securing-syfmony2-rest-service-wiith.html, and got the access token and the refresh token successfully. Now, I'm trying to test my server by creating a demo application that makes api requests.
the result of the request is "access_denied, Oauth2 authentication required", in spite the fact the the user was authenticated and the client received an access token.
when i tried to debug the process i noticed that the oauth2 authentication process never executed.

my security.yml:
jms_security_extra:
secure_all_services: false
expressions: true

security:
acl:
connection: default

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

providers:
    in_memory:
        memory:
            users:
                user:  { password: userpass, roles: [ 'ROLE_USER' ] }
                admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
    fos_userbundle:
        id: fos_user.user_provider.username

encoders:
      FOS\UserBundle\Model\UserInterface: sha512
      Symfony\Component\Security\Core\User\User: plaintext

firewalls:
    api:
        pattern: ^/api
        fos_oauth: true
        stateless: true

    oauth_authorize:
        pattern: ^/oauth/v2/auth
        form_login:
            provider: fos_userbundle
            check_path: /oauth/v2/auth_login_check
            login_path: /oauth/v2/auth_login
            use_referer: true
        anonymous: true

    oauth_token:
        pattern: ^/oauth/v2/token
        security: false  

    secured_area:
        pattern:    ^/
        anonymous: ~
        form_login:
            provider: fos_userbundle
            check_path: /login_check
            login_path: /login
            always_use_default_target_path: true
            default_target_path: /

access_control:
    - { path: ^/oauth/v2/auth_login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/oauth/v2/auth, role: ROLE_USER }
    - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY}
    - { path: ^/, roles: ROLE_USER }
    - { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ] }

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.