小编jsa*_*sam的帖子

可能/如何使用jquery.tabs()在垂直制表符下嵌套水平制表符?

我试图用jQuery嵌套标签,一些水平和一些垂直.我发现谷歌代码"垂直标签"项目在这里,并把它纳入我的项目.我的(简化)HTML是:

<div class="htab-outer">
  <ul>...</ul>
  <div class="vtab">
    <ul>...</ul>
    <div class="htab-inner">
      <ul>...</ul>
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我的Javascript看起来像:

$(function() {
  $(".htab-outer").tabs(); 
  $(".vtab").tabs().addClass("ui-tabs-vertical ui-helper-clearfix");
  $(".vtab li").removeClass("ui-corner-top").addClass("ui-corner-left");
  $(".htab-inner").tabs();
  // I've tried with and without the following line and noticed no difference
  $(".htab-inner").removeClass("ui-tabs-vertical");
});
Run Code Online (Sandbox Code Playgroud)

最后,垂直选项卡CSS是:

.ui-tabs-vertical { width: 55em; }
.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
.ui-tabs-vertical .ui-tabs-nav …
Run Code Online (Sandbox Code Playgroud)

css jquery jquery-ui

3
推荐指数
1
解决办法
4636
查看次数

Amazon Cognito 中使用 boto3 和授权的 DEVICE_PASSWORD_VERIFIER 质询响应

我正在使用 boto3 和授权库来尝试对设备进行身份验证,以在识别后跳过多因素身份验证。我已经通过了用户/密码身份验证,但似乎无法找出验证设备的正确方法。以下是我的代码:

from warrant import aws_srp
from warrant.aws_srp import AWSSRP
import boto3
client = boto3.client('cognito-idp')
import datetime

username='xxx'
password='xxx'
client_id='xxx'

aws = AWSSRP(username=username, password=password, pool_id='xxx',
client_id=client_id, client=client)

auth_init = client.initiate_auth(
    AuthFlow='USER_SRP_AUTH',
    AuthParameters={
        'USERNAME': username,
    'SRP_A': aws_srp.long_to_hex(aws.large_a_value),
    },
    ClientId=client_id,
)

cr = aws.process_challenge(auth_init['ChallengeParameters'])
response = client.respond_to_auth_challenge(
    ClientId=client_id,
    ChallengeName=auth_init['ChallengeName'],
    ChallengeResponses=cr
)

response = client.respond_to_auth_challenge(
    ClientId=client_id,
    ChallengeName='SMS_MFA',
    Session=response['Session'],
    ChallengeResponses={
        'USERNAME': username,
        'SMS_MFA_CODE':'xxx'
    }
)

response_dev = client.confirm_device(
    AccessToken=response['AuthenticationResult']['AccessToken'],
    DeviceKey=response['AuthenticationResult']['NewDeviceMetadata']['DeviceKey'],
DeviceSecretVerifierConfig={ 
    "PasswordVerifier": aws_srp.long_to_hex(aws.large_a_value),
    "Salt": aws_srp.long_to_hex(aws.small_a_value)
}
)

response = client.update_device_status(
    AccessToken=response['AuthenticationResult']['AccessToken'],
    DeviceKey=device,
    DeviceRememberedStatus='remembered' …
Run Code Online (Sandbox Code Playgroud)

python srp-protocol amazon-cognito boto3 multi-factor-authentication

2
推荐指数
1
解决办法
4244
查看次数