我尝试点击文档中的GET A CONFIGURATION FILE链接,但生成的页面只是加载和加载.这种情况发生在Firefox和Chrome以及我的手机上.有没有其他方法来获取配置文件?
编辑:我在Chrome开发者控制台中收到这些错误:
Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').(anonymous function) @ script_foot.js:348n.event.dispatch @ jquery.min.js:3r.handle @ jquery.min.js:3
Run Code Online (Sandbox Code Playgroud) 我正在使用systemd在ubuntu 16.04机器上启动一个caddy webserver.每当我跑sudo service caddy start和service caddy status,我得到这个错误:
? caddy.service - Caddy webserver
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2016-08-29 05:03:02 EDT; 4s ago
Docs: https://caddyserver.com/
Process: 1135 ExecStart=/usr/local/bin/caddy -agree -email me@example -pidfile=/var/run/caddy/caddy.pid (code=exited, status
Main PID: 1135 (code=exited, status=1/FAILURE)
systemd[1]: Started Caddy webserver.
caddy[1135]: Activating privacy features... done.
caddy[1135]: 2016/08/29 05:03:02 Caddyfile:12 - Parse error: unknown property 'errors'
systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: caddy.service: Unit …Run Code Online (Sandbox Code Playgroud) 我有一个 node.js 服务器,它使用 google-passport-oauth2 进行身份验证。我的服务器端代码看起来像文档中的那样:
app.get('/auth/google',
passport.authenticate('google', { scope:
[ 'https://www.googleapis.com/auth/plus.login',
, 'https://www.googleapis.com/auth/plus.profile.emails.read' ] }
));
app.get( '/auth/google/callback',
passport.authenticate( 'google', {
successRedirect: '/auth/google/success',
failureRedirect: '/auth/google/failure'
}));
Run Code Online (Sandbox Code Playgroud)
我认为这会/auth/google重定向到 google 的登录名,并且在收到权限时,会将 google 个人资料和令牌发送到 callback /auth/google/callback。
现在我正在制作一个想要使用此 API 进行身份验证的 android 应用程序。我正在使用集成 Google Sign-In的说明在 google 端进行身份验证。现在我的 android 应用程序有配置文件和令牌,并想用我的服务器验证它。
我试过用passport-google-token和passport-google-id-token(不确定区别......)来做这件事,但无论出于何种原因它都不起作用。现在我正在寻找其他可能性,例如 node.js 的 Google 客户端 API 库,但它看起来很笨重。然后是 tokeninfo 端点,它涉及额外的请求和更多的延迟。或者我应该看看express-jwt?
突然间,我想知道......我不能将令牌从我的 android 应用程序传递到服务器auth/google/callback吗?那会让事情变得简单一些。我认为这一定是一个白日梦,因为我还没有找到任何关于这样做的信息。但是如果可能的话,我应该如何格式化请求中的令牌/配置文件数据,以便passport.authenticate()方法识别它?(JSON,表单数据,标题)
如果无法做到这一点,我正在为节点提供有据可查的令牌验证库的建议......
除了我使用nunjucks作为模板引擎之外,这与此问题基本相同.
我使用express的render方法将变量传递给nunjucks模板:
res.render('template.html', {myObject:myObject})
Run Code Online (Sandbox Code Playgroud)
我想在我的客户端javascript中访问它.到目前为止,我想出的唯一方法是将它放在一个不可见的HTML元素中,并从那里将其拉入javascript:
<span id='local-variable' style="display:none">{{ myObject.name }}</span>
<script>
var myObjectName = $('#local-variable').text();
</script>
Run Code Online (Sandbox Code Playgroud)
有更好的方法吗?
这是我正在运行的命令及其错误:
# git log --pretty=format:"%ad" --date=format-local:"%y-%m-%d %k:%M"
fatal: unknown date format format-local:%y-%m-%d %k:%M
Run Code Online (Sandbox Code Playgroud)
相同的命令在其他机器上运行良好。我在 ubuntu docker 容器中遇到了这个错误。其他格式抛出相同的错误:
# git log --pretty=format:"%ad" --date=format-local:"%M"
fatal: unknown date format format-local:%M
# git log --pretty=format:"%ad" --date=format-local:"%m"
fatal: unknown date format format-local:%m
# git log --pretty=format:"%ad" --date=format:"%m"
fatal: unknown date format format:%m
Run Code Online (Sandbox Code Playgroud)
似乎我缺少一个不属于 docker 映像的日期格式依赖项。
编辑:我正在使用 git 版本 1.9.1。