-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from unicef-drp/feature-authorization-server
Feature authorization server
- Loading branch information
Showing
8 changed files
with
176 additions
and
5 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
22 changes: 22 additions & 0 deletions
22
django_project/azure_auth/migrations/0003_thirdpartyapplication.py
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,22 @@ | ||
# Generated by Django 4.0.7 on 2023-07-27 18:53 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('azure_auth', '0002_remove_email_liveprefix'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ThirdPartyApplication', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=256, unique=True)), | ||
('client_id', models.CharField(max_length=256, unique=True)), | ||
('origin', models.CharField(help_text='Domain with protocol, e.g. https://domainA.com', max_length=256)), | ||
], | ||
), | ||
] |
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,95 @@ | ||
<!-- templates/third_party.html --> | ||
{% load static %} | ||
{% load randombg %} | ||
{% randombg as random_bg_image %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>GeoRepo | Sign In</title> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no"/> | ||
<link rel="stylesheet" | ||
href="https://fonts.googleapis.com/css?family=Rubik:300,300i,500,500i"/> | ||
<link rel="stylesheet" href={% static 'base.css' %}> | ||
<link rel="stylesheet" href={% static 'login.css' %}> | ||
<link rel="stylesheet" href={% static 'navbar.css' %}> | ||
<style> | ||
.login-main .background { | ||
background: url('{% static random_bg_image %}'); | ||
background-size: cover; | ||
} | ||
|
||
#loading { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding-top: 20px; | ||
padding-bottom: 20px; | ||
} | ||
|
||
#loading > span { | ||
margin-left: 10px; | ||
} | ||
|
||
#loading-spinner { | ||
display: inline-block; | ||
width: 30px; | ||
height: 30px; | ||
border: 3px solid rgba(255,255,255,.3); | ||
border-radius: 50%; | ||
border-top-color: var(--primary-color); | ||
animation: spin 1s ease-in-out infinite; | ||
-webkit-animation: spin 1s ease-in-out infinite; | ||
} | ||
|
||
@keyframes spin { | ||
to { -webkit-transform: rotate(360deg); } | ||
} | ||
@-webkit-keyframes spin { | ||
to { -webkit-transform: rotate(360deg); } | ||
} | ||
|
||
</style> | ||
<script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script> | ||
<script> | ||
$(function() { | ||
if (window.opener == null) window.location = "/"; | ||
setTimeout(function() { | ||
window.opener.postMessage("{{ access_token }}", "{{ requester }}"); | ||
$('#loading').hide(); | ||
// show success message | ||
$('#success-message').show(); | ||
}, 1500); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="login-app"> | ||
<div class="login-root"> | ||
<div class="login-header"> | ||
{% include "navbar.html" %} | ||
</div> | ||
<div class="login-main"> | ||
<div class="background"> | ||
</div> | ||
<div class="login-container signup-form"> | ||
<div class="login-form-header"> | ||
GeoRepo Sign In | ||
</div> | ||
<div class="login-form"> | ||
<div id="loading"> | ||
<div id="loading-spinner"></div> | ||
<span>Logging in to GeoRepo...</span> | ||
</div> | ||
<p id="success-message" style="display: none;">You have successfully logged in. You may close this browser tab.</p> | ||
<p id="error-message" style="display: none;">There is an unexpected error during sign in process. Please try again or contact administrator!</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
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
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
ac39f54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report for
django_project/dashboard
Test suite run success
12 tests passing in 5 suites.
Report generated by 🧪jest coverage report action from ac39f54