token

Redmine can't generate secret token

馋奶兔 提交于 2019-12-08 06:17:23
问题 I have problem with generating secret token. I'm was trying this: [redmine]# rake generate_secret_token rake aborted! LoadError: cannot load such file -- rspec/core /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in require' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in block in require' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb

Does ServiceStack support Token based authentication?

雨燕双飞 提交于 2019-12-08 05:46:22
问题 Asp.net Web api has out of the box support for token based authentication with minor configuration settings. I havent found anything like that for servicestack. Is there anyway how I can setup servicestack to provide tokens on authentication instead of session id. 回答1: ServiceStack includes support for JWT built-in there are also a couple of other projects that enable token-based authentication with ServiceStack: StatelessAuthentication Using IdentityServer 4 with ServiceStack and Angular

REST API authentication tokens

允我心安 提交于 2019-12-08 05:17:43
问题 I'm building my first REST API from scratch and am trying to understand the best way to handle API tokens. I'm not talking about "user authentication" (I would be using OAuth for that). I'm talking about public/private tokens that an application uses to identify itself so that my API can decide whether or not the application is allowed to use the API in the first place. Some API resources will be available to anyone with valid token(s), and some will require OAuth authentication. I will be

Why my auth0 token expires when refreshing page or clicking link in my Angular app?

江枫思渺然 提交于 2019-12-08 05:09:50
问题 I'm setting up authentication in my Angular SPA. I'm using auth0 and I was going through a tutorial on their page: https://auth0.com/docs/quickstart/spa/angular2 I did login tutorial. import { Injectable } from '@angular/core'; import * as auth0 from 'auth0-js'; import { Router } from '@angular/router'; @Injectable({ providedIn: 'root' }) export class AuthService { userProfile: any; private _idToken: string; private _accessToken: string; private _expiresAt: number; auth0 = new auth0.WebAuth({

What is the regular expression for the set of strings that validate exactly the same for xsd:token and xsd:string?

*爱你&永不变心* 提交于 2019-12-08 04:21:43
问题 I want write an XSD to restrict the content of valid XML elements of type xsd:token such that at validation they would indistinguishable from the same content wrapped in xsd:string. I.e. they do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, begin or end with a space (#x20) character, and do not include a sequence of two or more adjacent space characters. I think the regular expression to use is this: \S+( \S+)* (some non-whitespace, optional [single spaces

I can't retrieve an access token from Spotify for my app

橙三吉。 提交于 2019-12-08 04:08:41
问题 I can't get an access token for my Android app from Spotify because I can connect to the end point. I need the access token of my Android app and I tried the following: 1) Spotify Android auth library. I can't find the spotify-auth-version.aar they talk about. 2) building manually the url. Here is an example: https://accounts.spotify.com/authorize? client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx& response_type=code& redirect_uri=http%3A%2F%2Fmarcoalunno.com.spotify_test%2Fcallback& scope=playlist-read

微信token验证失败Java解决办法

会有一股神秘感。 提交于 2019-12-08 03:54:41
微信token验证失败Java解决办法,PHP后台的自己百度,先来一张熟悉的图 说我 token验证失败, 是不是因为我的token填写了jinsanpang(金三胖)了 ? 貌似这个token没有说明填写神马,看说明 必须为英文或数字,长度为3-32字符。 也就是说token是自定义的,也就是瞎鸡巴写都没事。 我们看下上面的URL, 那么这个URL填写神马了? 这个URL跟下面的token到底有神马关系了 ? 重重疑问。。蛋疼! 但是我们找到了一句话 也就是微信需要一个请求一个URL来响应token验证,so !!! 也就是你点击确定的时候是向你指定的URL发送一个请求,在请求里面验证你的token是否正确。 也就是我们需要一个外网接口让微信访问,这个接口不需要传入任何参数;注意必须是外网服务器接口,微信才能调用. 所以我写了一个接口放在服务器上,接口代码如下 @RequestMapping("/wechat") @Controller public class WechatController { private static Logger logger = Logger.getLogger(WechatController.class); private static String token = "jinsanpang"; @RequestMapping(value = "

angular2-jwt check if token is expired in component?

不羁的心 提交于 2019-12-08 03:36:42
问题 Is it possible to check whether a id token is expired or not inside a component of angular 2 app? I got an AuthService with the method public isAuthenticated(): boolean { /* check if id_token is expired or not */ return tokenNotExpired(); } Used inside the template it works fine. If a user is signed out it returns false, after the user signed in angular change detection reruns the function in the template and it returns true. Used inside a component @Component({ selector: 'app', providers: [

Is it possible to set a struts token with a GUID as a token name?

本秂侑毒 提交于 2019-12-08 02:25:31
问题 I'm trying to set a struts token in a form with a unique name for each form. Is there way to set up the token in a way like <s:token name="<some random generated characters>" . I was planning to use the TokenHelper.generateGUID() to generate the token name, if possible. I've tried setting a variable using <s:set var="tokenName" value="<%=TokenHelper.generateUID()%>"/> , then setting the token using <s:token name="${tokenName}"/> . I'm getting tld error about setting the in the tag. Here is

node后端使用jwt实现跨域认证--生成token、验证token是否无效和过期

一笑奈何 提交于 2019-12-07 20:05:44
JSON Web Token(缩写 JWT)是目前最流行的跨域认证解决方案 引入jwt var jwt = require('jsonwebtoken'); 生成token 在登录时,如果用户名和密码正确,则使用jwt生成token,返回给前端 let { username, password } = req.body; . . . //jwt生成加密token,username是公文,密钥是“secret”,1小时后过期 token = jwt.sign({ username }, "secret", { expiresIn: 60 * 60 * 1 }); . . . res.json({ code: 0, msg: '登录成功', token: token, userName: username }); 解析token 在所有需要登录验证的请求中,获取请求头中的token,使用jwt解析此token let token = req.headers.authorization; if (token) { jwt.verify(token, 'secret', (err, decoded) => { if (err) { switch (err.name) { case 'JsonWebTokenError': res.status(403).send({ code: -1,