我正在使用auth0对用户进行身份验证,以接收包含以下声明的id令牌
"http://myapp.com/scope": "write"
Run Code Online (Sandbox Code Playgroud)
使用带有OpenID身份验证提供程序的Cognito身份池(即auth0),我能够成功获取临时凭据以访问aws服务.但是,我想根据上面的自定义声明限制对这些服务的访问.我认为正确的方法是编辑与我的身份池关联的信任策略,但我不确定如何在我的信任策略中添加条件来检查上述声明.
当前的默认信任策略是
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "cognito-identity.amazonaws.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"cognito-identity.amazonaws.com:aud": "us-east-2:078855cf-aa9b-400e-a762-dfcf27ec495c"
},
"ForAnyValue:StringLike": {
"cognito-identity.amazonaws.com:amr": "authenticated"
}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
如何确保只有具有auth0 "write"范围的用户才能访问我的s3服务?
更新:
我能够通过避免认知身份池将原始id_token传递给aws.但是,auth0强制我的自定义声明被命名空间"http://mywebsite.com"
.这是一个问题,因为IAM在我的情况下不允许多个冒号.我需要添加条件
"ForAnyValue:StringLike": {
"food-flick.auth0.com/:https://foodflick.com/scope": "write:rests"
}
Run Code Online (Sandbox Code Playgroud)
但IAM不允许它,Auth0强迫我命名我的声明.我能做什么?我可以将我的范围存储在标准声明中,但这会产生误导.我可以将访问令牌而不是我的id_token传递给IAM吗?如果是这样,在给定值数组时,如何更改信任策略以检查适当的aud值?
amazon-s3 amazon-web-services amazon-iam amazon-cognito auth0
我的jsx文件成功识别react-bootstrap元素,但它们没有样式.我的项目的node-modules文件夹包含react-bootstrap和bootstrap.为什么会这样?
var React = require('react');
var Button = require('react-bootstrap').Button;
var Jumbotron = require('react-bootstrap').Jumbotron;
var ReactComponentHi = React.createClass({displayName: 'Hi',
render: function() {
return (
<div>
<Button bsStyle='success'>
clickk
</Button>
<Jumbotron>
<h1>Hello, world!</h1>
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p><Button bsStyle='primary'>Learn more</Button></p>
</Jumbotron>
</div>
);
}
});
module.exports = ReactComponentHi;
Run Code Online (Sandbox Code Playgroud)
作品
Template.Hello.onRendered(function() {
this.autorun(() => {
console.log('sup');
});
});
Run Code Online (Sandbox Code Playgroud)
不行.
Template.Hello.onRendered(() => {
this.autorun(() => {
console.log('sup');
});
});
Run Code Online (Sandbox Code Playgroud)
错误是TypeError:_this.autorun不是函数.
使用箭头符号的任何想法都会给我们这个错误?
我希望每个表格行都是可点击的,这样它就像手风琴一样展开,但是当手风琴激活时,它不会占据整行的长度.如何让它占据整行?代码如下.
<table class="ui selectable accordion fixed single line celled table">
<thead>
<tr>
<th class="one wide id-row">ID</th>
<th class="fifteen wide name-row">Name</th>
</tr>
</thead>
<tbody>
{{#each data}}
<tr class="appRow title">
<td class="id-row">{{_id}}</td>
<td class="name-row">{{name}}</td>
</tr>
<div class="content">
<tr>
<td colspan="2">{{> form}}</td>
</tr>
</div>
{{/each}}
</tbody>
Run Code Online (Sandbox Code Playgroud) meteor ×2
amazon-iam ×1
amazon-s3 ×1
angular ×1
auth0 ×1
ecmascript-6 ×1
jquery ×1
meteor-blaze ×1
node.js ×1
reactjs ×1
semantic-ui ×1