Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2015-12-21 22:01:14 +0000
committerRyan D. Brooks2015-12-21 22:01:14 +0000
commitd7c359722bf1a6fd3ee5bd202657b273b3373409 (patch)
tree3f1e41663ba980d3b25c9f179ea72daf288988ec /plugins/org.eclipse.osee.web.ui
parentbf73e2f0b898bcf54aca7ee1fe76c3edeb0b8c76 (diff)
downloadorg.eclipse.osee-d7c359722bf1a6fd3ee5bd202657b273b3373409.tar.gz
org.eclipse.osee-d7c359722bf1a6fd3ee5bd202657b273b3373409.tar.xz
org.eclipse.osee-d7c359722bf1a6fd3ee5bd202657b273b3373409.zip
bug: Enable OAuth to work with multiple servers through proxy
Change-Id: Ibb25c2ded9502745b9f91beb6e09fd53f2e10123 Conflicts: plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/OAuthEncryption.java
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/account/js/signInApp.js11
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/account/ui/loginError.html78
2 files changed, 87 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.web.ui/src/account/js/signInApp.js b/plugins/org.eclipse.osee.web.ui/src/account/js/signInApp.js
index 8741d82e177..6eababcfd94 100644
--- a/plugins/org.eclipse.osee.web.ui/src/account/js/signInApp.js
+++ b/plugins/org.eclipse.osee.web.ui/src/account/js/signInApp.js
@@ -1,7 +1,7 @@
(function() {
var app = angular.module('signInApp', [ 'ngRoute' ]);
-
+
app.controller('signInController', [
'$http',
'$location',
@@ -38,7 +38,14 @@
method : 'GET',
headers : header
}).success(function(data, status, headers, config) {
- location.assign(store.continueTo);
+ if(data.startsWith('<!--ERROR PAGE-->', 0)) {
+ var currentUrl = window.location.href;
+ var errorPage = currentUrl.replace("login", "loginError");
+ location.assign(errorPage);
+ } else {
+ location.assign(store.continueTo);
+ }
+
}).error(function(data, status, headers, config) {
alert("Failed to Log in")
});
diff --git a/plugins/org.eclipse.osee.web.ui/src/account/ui/loginError.html b/plugins/org.eclipse.osee.web.ui/src/account/ui/loginError.html
new file mode 100644
index 00000000000..8dae41b5acd
--- /dev/null
+++ b/plugins/org.eclipse.osee.web.ui/src/account/ui/loginError.html
@@ -0,0 +1,78 @@
+<!--ERROR PAGE-->
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8"></meta>
+<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
+<meta name="viewport" content="width=device-width, initial-scale=1"></meta>
+
+<link rel="stylesheet" type="text/css"
+ href="/ajax/libs/bootstrap/3.3.2/css/bootstrap.min.css"></link>
+
+<title>OSEE - Login Error</title>
+<style>
+html,body,.container {
+ height: 80%;
+}
+
+.container {
+ display: table;
+ vertical-align: middle;
+}
+
+.vertical-center-row {
+ display: table-cell;
+ vertical-align: middle;
+}
+
+.text-center-row {
+ text-align: center;
+}
+</style>
+
+<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
+<!--[if lt IE 9]>
+ <script src="/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
+ <script src="/ajax/libs/respond/1.4.2/respond.min.js"></script>
+ <![endif]-->
+</head>
+<body ng-app="signInApp" ng-controller="signInController as cntrl">
+ <div class="container">
+ <div class="row vertical-center-row">
+ <div class="col-lg-12">
+ <div class="row">
+ <div class="col-md-4 col-md-offset-4">
+ <div class="text-center-row">
+ <div class="media-body lead">
+ <h1 class="media-heading">OSEE</h1>
+ <i>Wrong Username/Password. Please try again </i>
+ </div>
+ </div>
+ <div class="well">
+ <form name="form" ng-submit="cntrl.submit()">
+ <div class="form-group warning">
+ <input type="text" class="form-control error" id="username"
+ name="username" placeholder="Username" ng-model="cntrl.formData.username"
+ ng-model-options="{updateOn: 'blur'}" required>
+ </div>
+ <div class="form-group"
+ ng-class="{'has-error': form.password.$invalid && submitted}">
+ <input type="password" class="form-control" id="password"
+ name="password" placeholder="Password" ng-model="cntrl.formData.password"
+ ng-model-options="{updateOn: 'blur'}" required>
+ </div>
+ <button type="submit" class="btn btn-primary btn-block">Login</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script src="/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+ <script src="/ajax/libs/angularjs/1.3.11/angular.min.js"></script>
+ <script src="/ajax/libs/angularjs/1.3.11/angular-route.min.js"></script>
+
+ <script src="/account/js/signInApp.js"></script>
+</body>
+</html> \ No newline at end of file

Back to the top