Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authentication process description #416

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,40 @@ class YourApiController extends Controller
}
```

__Note__: Your favorite authentication process is one of the following: ```x509```, ```remote_user```, ```http_basic```, ```http_basic_ldap```, ```http_digest```, ```guard```, ```form_login```, ```form_login_ldap```. To get more information, visit the [security configuration reference page](http://symfony.com/doc/current/reference/configuration/security.html).

__Example__: With ```http_basic```

```yaml
# app/config/security.yml
security:
providers:
in_memory:
memory:
users:
admin: { password: admin }

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

oauth_authorize:
pattern: ^/oauth/v2/auth
http_basic:
provider: in_memory

api:
pattern: ^/api
fos_oauth: true
stateless: true
anonymous: false # can be omitted as its default value

access_control:
- { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ] }

```

### Step 5: Configure FOSOAuthServerBundle

Import the routing.yml configuration file in app/config/routing.yml:
Expand Down