{"action":"opened","issue":{"url":"https://api.github.com/repos/realdoug/omniauth-salesforce/issues/21","repository_url":"https://api.github.com/repos/realdoug/omniauth-salesforce","labels_url":"https://api.github.com/repos/realdoug/omniauth-salesforce/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/realdoug/omniauth-salesforce/issues/21/comments","events_url":"https://api.github.com/repos/realdoug/omniauth-salesforce/issues/21/events","html_url":"https://github.com/realdoug/omniauth-salesforce/issues/21","id":181381524,"number":21,"title":"Rails: Salesforce Omniauth able to logout from my application but not logout from salesforce","user":{"login":"rajcybage","id":3119321,"avatar_url":"https://avatars.githubusercontent.com/u/3119321?v=3","gravatar_id":"","url":"https://api.github.com/users/rajcybage","html_url":"https://github.com/rajcybage","followers_url":"https://api.github.com/users/rajcybage/followers","following_url":"https://api.github.com/users/rajcybage/following{/other_user}","gists_url":"https://api.github.com/users/rajcybage/gists{/gist_id}","starred_url":"https://api.github.com/users/rajcybage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajcybage/subscriptions","organizations_url":"https://api.github.com/users/rajcybage/orgs","repos_url":"https://api.github.com/users/rajcybage/repos","events_url":"https://api.github.com/users/rajcybage/events{/privacy}","received_events_url":"https://api.github.com/users/rajcybage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-06T10:42:19Z","updated_at":"2016-10-06T10:42:19Z","closed_at":null,"body":"I have one Rails application where I am using salesforce omniauth\r\n\r\nI am able to logout by making reset_session. But I am not completely logout from salesforce as when user again click login it will redirect to omniauth and login automatically.\r\n\r\nI did below steps\r\n\r\ngem 'omniauth-salesforce'\r\n\r\nand model\r\n\r\n\r\n``````\r\nclass User < ActiveRecord::Base\r\n    def self.from_omniauth(auth)\r\n      where(auth.slice(:provider, :uid).permit!).first_or_initialize.tap do |user|\r\n        user.provider = auth.provider\r\n        user.uid = auth.uid\r\n        user.name = auth.info.name\r\n        user.oauth_token = auth.credentials.token\r\n        user.refresh_token = auth.credentials.refresh_token\r\n        user.instance_url = auth.credentials.instance_url\r\n        user.save!\r\n      end\r\n    end\r\n  end\r\n`````\r\n\r\n\r\n````\r\nclass SessionsController < ApplicationController\r\n    def create\r\n      user = User.from_omniauth(env[\"omniauth.auth\"])\r\n      session[:user_id] = user.id\r\n      redirect_to root_url\r\n    end\r\n\r\n    def destroy\r\n      session[:user_id] = nil\r\n      redirect_to root_url\r\n    end\r\n  end\r\n end\r\n\r\n````\r\n\r\n\r\nI am new on salesforce omniauth. Please suggest how can I able to logout from my app as well as salesforce both."}}
{"actor":{"display_login":"rajcybage"}}