Giter Site home page Giter Site logo

steamauthbundle's Introduction

SteamAuthBundle

Steam Authentication for Symfony

Configuration and Usage

A couple things are necessary for this bundle to work. Your user class will have to be managed by Doctrine ORM (does not support Mongo or Propel at the moment.) At first, add the EightPoints GuzzleBundle and the SteamAuthBundle to your AppKernel.php

$bundles = [
...
new EightPoints\Bundle\GuzzleBundle\GuzzleBundle(),
new SteamAuthBundle\SteamAuthBundle()
...
];

In the app/config/config.yml you will need the following parameters

steam_auth:
    steam_key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    user_class: AppBundle\Entity\User

And your security yml firewall will need

  • steam as a firewall option
  • with a default_route option with the name of the route to go to once a user has logged in
  • a user provider marked as steam.user_provider
security:
    providers:
        steamauth:
            id: steam.user_provider

    firewalls:
        main:
            provider: steamauth
            steam:
                default_route: home

Your User class will need to implement SteamAuthBundle\Security\User\SteamUserInterface as well as Symfony\Component\Security\Core\User\UserInterface

Note that this bundle will create a new instance of your user class with an empty default constructor, will set the username, nickname, avatar and password, and will persist it to the database. This occurs when a user signs in with their steam account and do not already exist in your database.

This bundle also works with Symfony's Remember Me functionality if you wish to use it.

main:
    steam:
        default_route: home
    remember_me:
        secret: '%secret%'

Login Template

On your login page, you can either use your own form with the OpenID parameters, or include the SteamAuthBundle Template

{% include "SteamAuthBundle:Login:login.html.twig" %}

steamauthbundle's People

Contributors

sirwaddles avatar levitas avatar

Watchers

 avatar

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.