-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
215 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{#oneid_base_url需要更改为本地开发环境IP:port#} | ||
|
||
Aliyun Role SSO Login | ||
<form class='form' method="POST"> | ||
username<input name="username"> | ||
password<input name="password"> | ||
<button type='button' id='submit'>submit</button> | ||
</form> | ||
<script src="https://code.jquery.com/jquery-latest.js"></script> | ||
<script type="text/javascript"> | ||
const oneid_base_url = 'http://localhost:8000' | ||
let next = oneid_base_url + '/saml/aliyun/sso-role/login/'; | ||
|
||
$('#submit').click(function(){ | ||
const username = $('input[name=username]').val(); | ||
const password = $('input[name=password]').val(); | ||
$.ajax({ | ||
method: 'POST', | ||
url: '{{token_url}}', | ||
data: {'username': username, 'password': password}, | ||
success: function(){ | ||
window.location.href = next; | ||
} | ||
}) | ||
return false; | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 2.2.10 on 2020-07-24 07:37 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import jsonfield.fields | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('oneid_meta', '0075_auto_20200612_1042'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='AliyunSSORole', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('uuid', models.UUIDField(default=uuid.uuid4, unique=True)), | ||
('is_del', models.BooleanField(default=False, verbose_name='是否删除')), | ||
('is_active', models.BooleanField(default=True, verbose_name='是否可用')), | ||
('updated', models.DateTimeField(auto_now=True, null=True, verbose_name='更新时间')), | ||
('created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='创建时间')), | ||
('role', jsonfield.fields.JSONField(blank=True, default=[], verbose_name='阿里云SSO角色分配')), | ||
('session_duration', models.IntegerField(blank=True, default=900)), | ||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='aliyun_sso_role', to='oneid_meta.User', verbose_name='用户')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters