Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
STS
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
apis
STS
Merge requests
!134
BREAKING: Migrated login to the new UI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
BREAKING: Migrated login to the new UI
Fix/xxxx-migrateLogin
into
dev
Overview
0
Commits
8
Pipelines
8
Changes
13
Merged
Petar Hristov
requested to merge
Fix/xxxx-migrateLogin
into
dev
2 years ago
Overview
0
Commits
8
Pipelines
8
Changes
13
Expand
coscine/issues#2034
Edited
2 years ago
by
Petar Hristov
0
0
Merge request reports
Compare
dev
version 7
b55aff3c
2 years ago
version 6
87a1a9e8
2 years ago
version 5
8f430c2d
2 years ago
version 4
c70fdc7a
2 years ago
version 3
d8bcc727
2 years ago
version 2
2b8dbd03
2 years ago
version 1
6a0a97f8
2 years ago
dev (base)
and
latest version
latest version
bf6afd0f
8 commits,
2 years ago
version 7
b55aff3c
7 commits,
2 years ago
version 6
87a1a9e8
6 commits,
2 years ago
version 5
8f430c2d
5 commits,
2 years ago
version 4
c70fdc7a
4 commits,
2 years ago
version 3
d8bcc727
3 commits,
2 years ago
version 2
2b8dbd03
2 commits,
2 years ago
version 1
6a0a97f8
1 commit,
2 years ago
13 files
+
171
−
162
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
src/STS/Controllers/AccountController.cs
+
23
−
18
Options
using
Coscine.Api.STS.Models
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Threading.Tasks
;
using
Coscine.Api.STS.Data
;
using
Coscine.Api.STS.Models
;
using
Coscine.Api.STS.Utils
;
using
Coscine.Api.STS.Data
;
using
Microsoft.AspNetCore.Identity
;
using
System
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Linq
;
using
Newtonsoft.Json
;
using
System.Threading.Tasks
;
namespace
Coscine.Api.STS.Controllers
{
@@ -19,18 +17,24 @@ namespace Coscine.Api.STS.Controllers
_signInManager
=
signInManager
;
}
[
Route
(
"[controller]/login"
)]
public
ActionResult
Login
(
string
returnUrl
)
/// <summary>
/// Return relevant URLs for logging the user in
/// </summary>
/// <returns>Return relevant URLs for logging the user in</returns>
[
HttpGet
(
"[controller]/urls/login"
)]
public
ActionResult
<
LoginUrls
>
GetLoginUrls
()
{
ViewBag
.
ReturnUrl
=
UrlGenerator
.
ExtendReturnUrl
(
returnUrl
,
Request
);
ViewBag
.
ORCiDUrl
=
ORCiDHandler
.
GetORCiDOAuthUrl
()
+
UrlGenerator
.
ORCiDRedirectUrl
();
System
.
Text
.
ASCIIEncoding
enc
=
new
System
.
Text
.
ASCIIEncoding
();
ViewBag
.
AppJs
=
enc
.
GetString
(
Program
.
Configuration
.
GetAndWait
(
"coscine/apps/login/appjs"
));
ViewBag
.
IdentityProviders
=
JsonConvert
.
SerializeObject
(
Startup
.
CurrentSaml2Options
?.
IdentityProviders
.
KnownIdentityProviders
.
Select
((
idp
)
=>
idp
.
EntityId
));
return
View
();
return
new
LoginUrls
{
OrcidUrl
=
ORCiDHandler
.
GetORCiDOAuthUrl
()
+
UrlGenerator
.
ORCiDRedirectUrl
(),
IdentityProviders
=
Startup
.
CurrentSaml2Options
?.
IdentityProviders
.
KnownIdentityProviders
.
Select
((
idp
)
=>
idp
.
EntityId
)
};
}
/// <summary>
/// Route for logging the user out of Coscine
/// </summary>
/// <returns>Redirects the user back to the login page</returns>
[
Route
(
"[controller]/logout"
)]
public
async
Task
<
ActionResult
>
Logout
()
{
@@ -47,13 +51,14 @@ namespace Coscine.Api.STS.Controllers
}
}
ViewBag
.
LoginUrl
=
UrlGenerator
.
GetLoginUrl
(
Request
)
+
"&logout=true"
;
ViewBag
.
LoginUrl
=
UrlGenerator
.
GetLoginUrl
(
Request
)
+
"?logout=true"
;
if
(
loggedInWithShibboleth
)
{
ViewBag
.
LoginUrl
+=
"&loggedInWithShibboleth=true"
;
}
return
View
(
);
return
Redirect
(
ViewBag
.
LoginUrl
);
}
}
}
Loading