- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有谁知道通过现有 Rails 3 应用程序处理 Zendesk API 用户身份验证的维护 gem?
我询问了 Zendesk IT 并被发送到 https://github.com/tobias/zendesk_remote_auth ,但它看起来与 rails 3 不兼容,并且自 2009 年以来未更新。
最佳答案
我认为我们文档中的文章给人的印象是 Zendesk SSO 很难,而实际上它很容易 (http://www.zendesk.com/api/remote-authentication)。
# reference http://www.zendesk.com/api/remote-authentication
# you need to be a Zendesk account admin to enable remote auth (if you have not already)
# go to Settings > Security, click "Enabled" next to Single Sign-On
# three important things to pay attention to:
# Remote Login URL, Remote Logout URL, and shared secret token
# for testing on a Rails 3 application running on localhost, fill in the Remote Login URL to map
# to http://localhost:3000/zendesk/login (we will need to make sure routes for that exist)
# fill in Remote Logout URL to http://localhost:3000/zendesk/logout
# copy the secret token, you'll need it later
# first, let's create those routes in config/routes.rb
namespace :zendesk do
match "/login" => "zendesk#login" # will match /zendesk/login
match "/logout" => "zendesk#logout" # will match /zendesk/logout
end
# Above I've mapped those requests to a controller named "zendesk" but it can be named anything
# next we want to add our secret token to the application, I added this in an initializer
# config/initializers/zendesk_auth.rb
ZENDESK_REMOTE_AUTH_TOKEN = "< your token >"
ZENDESK_REMOTE_AUTH_URL = "http://yourcompany.zendesk.com/access/remote/"
# Assuming we have a controller called zendesk, in zendesk_controller.rb
require "digest/md5"
class ZendeskController < ApplicationController
def index
@zendesk_remote_auth_url = ZENDESK_REMOTE_AUTH_URL
end
def login
timestamp = params[:timestamp] || Time.now.utc.to_i
# hard coded for example purposes
# really you would want to do something like current_user.name and current_user.email
# and you'd probably want this in a helper to hide all this implementation from the controller
string = "First Last" + "first.last@gmail.com" + ZENDESK_REMOTE_AUTH_TOKEN + timestamp.to_s
hash = Digest::MD5.hexdigest(string)
@zendesk_remote_auth_url = "http://yourcompany.zendesk.com/access/remote/?name=First%20Last&email=first.last@gmail.com×tamp=#{timestamp}&hash=#{hash}"
redirect_to @zendesk_remote_auth_url
end
def logout
flash[:notice] = params[:message]
end
end
# Note that the above index action defines an instance variable @zendesk_remote_auth_url
# in my example I simple put a link on the corresponding view that hits ZENDESK_REMOTE_AUTH_URL, doing so
# will cause Zendesk to hit your applications Remote Login URL (you defined in your Zendesk SSO settings) and pass a timestamp back in the URL parameters
# BUT, it is entirely possible to avoid this extra step if you just want to go to /zendesk/login in your app
# notice I am either using a params[:timestamp] if one exists or creating a new timestamp with Time.now
这个例子非常简单,但我只是想说明 Zendesk SSO 的基 native 制。请注意,我并没有涉及创建新用户或编辑现有用户的更复杂的问题,只是登录拥有现有 Zendesk 帐户的用户。
关于ruby-on-rails - 适用于 rails 3 的 Zendesk Single Sign-on gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5950866/
我提出这个问题是因为我没有找到关于这 3 个 gpg 选项之间差异的明确解释: gpg --sign file # produces file.gpg gpg --clear-sign
以下网页介绍了将 Google 登录集成到网络应用程序中的简单工作流程: https://developers.google.com/identity/sign-in/web/sign-in 实现代码
Microsoft 最近向 Azure AD B2C 添加了新的“注册或登录”策略。 https://azure.microsoft.com/en-us/documentation/articles/
鉴于此 xml: 如何选择包含 version="@2.15"的元素?我无法弄清楚如何将 @-sign 放入 XPath。 提前致谢, 埃里克 最佳答案 此 XPath 选择所
我正在为我的网站进行 Slack 集成,包括允许用户使用“使用 Slack 登录”按钮登录。理想情况下,我希望它只要求用户授予 identity.*权限一次,然后下次当他们单击“使用 Slack 登录
在将我的第二个应用程序项目上传到 PlayStore 时,在为新版本上传 .aab 文件时出现以下错误: "Your Android App Bundle is signed with the wro
As Math.sign() 接受数字参数或数字作为字符串,如 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Gl
我已经在我的网站上实现了 Sign In with Apple。但问题是它只适用于我开发者的 Apple ID。 我尝试在同一环境中使用我的个人 Apple ID,并且登录过程也运行良好。 但是,当真
Signed Short (Signed Int16) 乘法解释? short ss = -32768; // 0x8000 SHRT_MIN ss *= (short) -1; printf ("%
class Book attr_accessor :author attr_reader :title attr_reader :comments def initialize(aut
将我面向公众的应用程序部署到 Azure。旨在将身份验证委托(delegate)给 Microsoft、Google、Facebook、Apple 等。因此,一旦用户通过其声称的身份验证并且该提供商返
好吧,我对使用 API 的理解有限 我试图掌握 Adobe Sign API 并遇到了死胡同,在测试页面上我输入了这个并且它有效 但我不知道如何在 C# 中做到这一点 我尝试了以下方法,但知道它缺
上下文 我使用 booth Cognito 用户池和 Cognito 身份池来登录用户。 我想完成一个简单的任务,让用户在 iOS 应用程序(Swift 应用程序)上登录。 我的应用程序基于自定义版本
这可能是一个非常简单的答案,但我无法在任何地方找到它。可能是我以某种方式错过了一个非常基本的 CSS 规则。 这是我的 Sass 代码: h3 { font-size: 20px; m
我见过很多将 hex 转换为 int 的问题,但这些都是 unsigned-> unsigned 的变体。如何将带符号的十六进制转换为 Int? 例如。 somefunc('0xfffff830')
我对 C# 中的准备语句有疑问: OdbcCommand cmd = sql.CreateCommand(); cmd.CommandText = "SELECT UNIQUE_ID FROM use
我想知道是否有办法在我发送授权请求之前如果用户是第一次在 Apple 注册我的应用程序,或者他/她是否已经注册,只需登录即可。 基本上我的应用程序中有一个注册屏幕,用户可以在其中创建两种类型的用户和一
我是 Rails 的新手,我正在使用“设计”gem 进行身份验证。 首先,我通过默认注册页面(例如/users/sign_up)添加一个新用户 然后,我按照从 Devise before filter
当我使用 web3.eth.sign() 方法和 web3.eth.accounts.sign() 方法对字符串进行签名时。两个签名的结果值不同。我不知道为什么这两个结果不同。 我正在使用最新的 we
我正在使用受信任的 CA 颁发的证书签署 EXE 程序。 我正在使用 Windows SDK v6.0a 中的 signtool.exe。 该证书位于计算机商店中,位于“个人”文件夹中。 我的命令行是
我是一名优秀的程序员,十分优秀!