Coder Social home page Coder Social logo

loginza's Introduction

Loginza

Loginza - is interactive JavaScript widget provides visitors to your sites, a wide range of options for authentication through the accounts of common WEB-portals and service (Yandex, Google, and TA. See full list providers). Easy to learn Loginza.API.

Install

Via rails plugin:

Rails 3:

gem 'loginza'

Rails 2:

./script/plugin install git://github.com/galetahub/loginza.git

Via rails gem:

sudo gem install loginza

Usage

View

Simple example:

<%= loginza_button_tag("Login via OpenID", clients_url) %>

With set of providers:

<%= loginza_button_tag("Login via OpenID", clients_url, :providers => [ :google, :facebook, :twitter ]) %>

With default provider:

<%= loginza_button_tag("Login via OpenID", clients_url, :provider => :google) %>

With a block:

<%= loginza_button_tag(clients_url, :provider => :google) do %>
 <div class='loginza'>
   <img src="http://loginza.ru/img/providers/google.png" alt="Google" title="Google Accounts">
   <img src="http://loginza.ru/img/providers/twitter.png" alt="Twitter" title="Twitter">
   <img src="http://loginza.ru/img/providers/yandex.png" alt="Yandex" title="Yandex">
   <img src="http://loginza.ru/img/providers/myopenid.png" alt="MyOpenID" title="MyOpenID">
   <img src="http://loginza.ru/img/providers/openid.png" alt="OpenID" title="OpenID">
 </div>
<% end %>

Frame

<%= loginza_frame_tag(clients_url, { :providers => [:google, :yandex, :mailru] }, { :style => "width:400px;height:350px;" }) %>

Controller

class ClientsController < ApplicationController

  def create
    if data = Loginza.user_data(params[:token])
      client = Client.find_or_create(data)
      redirect_to root_path
    else
      redirect_to login_path
    end
  end    

end

Copyright © 2011 Aimbulance, released under the MIT license

loginza's People

Contributors

galetahub avatar superp avatar

Stargazers

Stanislav Bernstein avatar

Watchers

Stanislav Bernstein avatar James Cloos 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.