mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Test dispatch of action delivering bearer token
This commit is contained in:
@@ -116,7 +116,15 @@ export class AuthService {
|
||||
|
||||
public startShibbAuth(): Observable<AuthStatus> {
|
||||
console.log('startShibAuth() was called');
|
||||
return this.authRequestService.postToEndpoint('login').pipe(
|
||||
// Attempt authenticating the user using the supplied credentials.
|
||||
const user = 'test@test.at';
|
||||
const password = 'rest'
|
||||
const body = (`password=${Base64EncodeUrl(password)}&user=${Base64EncodeUrl(user)}`);
|
||||
const options: HttpOptions = Object.create({});
|
||||
let headers = new HttpHeaders();
|
||||
headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');
|
||||
options.headers = headers;
|
||||
return this.authRequestService.postToEndpoint('login', body, options).pipe(
|
||||
map((status: AuthStatus) => {
|
||||
if (status.authenticated) {
|
||||
return status;
|
||||
@@ -124,6 +132,7 @@ export class AuthService {
|
||||
throw(new Error('Invalid email or password'));
|
||||
}
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -38,17 +38,17 @@
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2"
|
||||
href="https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login"
|
||||
role="button"
|
||||
(click)="dispatchShibbLoginAction()">HardCoded Shibb</a>
|
||||
>HardCoded Shibb</a>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div >
|
||||
<div >
|
||||
<br>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" (click)="dispatchShibbLoginAction()" role="button">Dispatch Shibb Login</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div >
|
||||
<!-- <div >
|
||||
<br>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" (click)="postLoginCall()" role="button">Simple Post Login</a>
|
||||
</div>-->
|
||||
|
Reference in New Issue
Block a user