# OAuth\_Error with Okta's Angular sign in widget

**URL:** <https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145>\
**Category:** OAuth/OIDC\
**Tags:** widget, angular\
**Created:** [June 6, 2017, 1:19pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145 "2017-06-06T13:19:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pabhishek09](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pabhishek09](https://devforum.okta.com/u/pabhishek09)\
**Post date:** [June 6, 2017, 1:19pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/1 "2017-06-06T13:19:32Z")

</div>

Hi, I used Okta’s SPA sign in widget as documented. I am getting the following error -  
error.errorCode: unsupported\_response\_type, error.description: The authorization server does not support the requested response type. Why is this

Error details

```
r {name: "OAUTH_ERROR", message: "The authorization server does not support the requested response type."}
message
:
"The authorization server does not support the requested response type."
name
:
"OAUTH_ERROR"

```

---

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tom/32/24_2.png) [@tom](https://devforum.okta.com/u/tom)\
**Post date:** [June 6, 2017, 3:26pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/2 "2017-06-06T15:26:41Z")

</div>

Mind sharing your widget initialization code? Also, what are you using the widget for (so we can understand what you are building towards)? Are you building a login for the end-user tile screen for Okta or login for your application?

---

<div class="post-metadata">

**Author:** ![pabhishek09](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pabhishek09](https://devforum.okta.com/u/pabhishek09)\
**Post date:** [June 6, 2017, 4:31pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/3 "2017-06-06T16:31:42Z")

</div>

Hi Tom. My attempt here is to configure the okta authentication using the widget. The application will have two access routes - one via okta home page(where we have an ecosystem of existing applications) and another when the user wants to go the application directly. The users who will have have the application access will be configured by the okta-admin team.

---

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tom/32/24_2.png) [@tom](https://devforum.okta.com/u/tom)\
**Post date:** [June 6, 2017, 6:06pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/4 "2017-06-06T18:06:38Z")

</div>

Can you share your widget initialization code?

---

<div class="post-metadata">

**Author:** ![pabhishek09](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pabhishek09](https://devforum.okta.com/u/pabhishek09)\
**Post date:** [June 7, 2017, 3:55pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/5 "2017-06-07T15:55:31Z")

</div>

The code is as documented in [https://developer.okta.com/blog/2017/03/27/angular-okta-sign-in-widget](https://developer.okta.com/blog/2017/03/27/angular-okta-sign-in-widget)

This is the login component where I want the authentication to happen

import { Component, OnInit, ViewChild } from ‘@angular/core’;  
import { LoginService } from ‘./login.service’;  
import { LoginDetailsService } from ‘…/Shared/Services/LoginDetailsServices/login-details.service’;  
import { InternalisationService } from ‘…/Shared/Internationalisation/internationalisation.service’;  
import { Okta } from ‘…/Shared/Services/OktaService/okta.service’;  
@Component({  
selector: ‘app-login’,  
templateUrl: ‘./login.component.html’,  
styleUrls: [’./login.component.css’]  
})

export class LoginComponent implements OnInit {

title = ‘app works!’;  
user;  
oktaSignIn;

constructor(private okta: Okta) {  
this.oktaSignIn = okta.getWidget();  
}

showLogin() {  
this.oktaSignIn.renderEl({el: ‘#okta-login-container’}, (response) =\> {  
if (response.status === ‘SUCCESS’) {  
this.user = response.claims.email;  
}  
});  
}

ngOnInit() {  
this.oktaSignIn.session.get((response) =\> {  
if (response.status !== ‘INACTIVE’) {  
this.user = response.login  
} else {  
this.showLogin();  
}  
});  
}

logout() {  
this.oktaSignIn.signOut(() =\> {  
this.showLogin();  
this.user = undefined;  
});  
}  
}

The login html component -

 Hello {{user}}

\<button (click)=“logout()”\>Logout

The Okta service is same as documented. Really appreciate you taking a look at this.

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [June 7, 2017, 4:01pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/6 "2017-06-07T16:01:20Z")

</div>

Hello,

This error is somewhat misleading. It can happen when you don’t have your OIDC app setup correctly on Okta. Can you confirm you’ve configured it with the following settings?

Login to your Okta account and navigate to **Admin \> Add Applications** and click on the **Create New App** button. Select **Single Page App (SPA)** for the Platform and **OpenID Connect** for the sign on method. Click the **Create** button and give your application a name. On the next screen, add **[http://localhost:4200](http://localhost:4200)** as a Redirect URI and click **Finish**. You should see settings like the following.

 ![OIDC Settings](https://global.discourse-cdn.com/oktadev/original/1X/c17561f71e47b43e8a01d13f3b21293ba331da40.png)

Note: These are the same as what’s posted in the blog post: [https://developer.okta.com/blog/2017/03/27/angular-okta-sign-in-widget#create-an-openid-connect-app-in-okta](https://developer.okta.com/blog/2017/03/27/angular-okta-sign-in-widget#create-an-openid-connect-app-in-okta).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 12, 2024, 7:03pm UTC](https://devforum.okta.com/t/oauth-error-with-oktas-angular-sign-in-widget/145/7 "2024-01-12T19:03:34Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
