Skip to content

Commit 96293a0

Browse files
committed
JAVA-35533 Issues fix found during end to end testing
1 parent 22ecea8 commit 96293a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

oauth-jwt/oauth-ui-authorization-code-angular-jwt/src/main/resources/src/app/app.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class Foo {
1313

1414
@Injectable()
1515
export class AppService {
16-
public clientId = 'newClient';
16+
public clientId = 'jwtClient';
1717
public redirectUri = 'http://localhost:8084/';
1818

1919
constructor(
@@ -23,10 +23,11 @@ export class AppService {
2323
let params = new URLSearchParams();
2424
params.append('grant_type','authorization_code');
2525
params.append('client_id', this.clientId);
26+
params.append('client_secret', 'jwtClientSecret');
2627
params.append('redirect_uri', this.redirectUri);
2728
params.append('code',code);
2829

29-
let headers = new HttpHeaders({'Content-type': 'application/x-www-form-urlencoded; charset=utf-8'});
30+
let headers = new HttpHeaders({'Content-type': 'application/x-www-form-urlencoded; charset=utf-8', 'Authorization': 'Basic '+btoa(this.clientId+":secret")});
3031
this._http.post('http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/token', params.toString(), { headers: headers })
3132
.subscribe(
3233
data => this.saveToken(data),
@@ -39,7 +40,7 @@ export class AppService {
3940
Cookie.set("access_token", token.access_token, expireDate);
4041
Cookie.set("id_token", token.id_token, expireDate);
4142
console.log('Obtained Access token');
42-
window.location.href = 'http://localhost:8089';
43+
window.location.href = 'http://localhost:8084';
4344
}
4445

4546
getResource(resourceUrl) : Observable<any>{

oauth-jwt/oauth-ui-authorization-code-angular-jwt/src/main/resources/src/app/foo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {AppService, Foo} from './app.service'
2020

2121
export class FooComponent {
2222
public foo = new Foo(1,'sample foo');
23-
private foosUrl = 'http://localhost:8081/resource-server/api/foos/';
23+
private foosUrl = 'http://localhost:8081/jwt-resource-server/api/foos/';
2424

2525
constructor(private _service:AppService) {}
2626

0 commit comments

Comments
 (0)