Skip to content

Support for authorization code flow #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
b-wins opened this issue Feb 28, 2018 · 17 comments
Closed

Support for authorization code flow #249

b-wins opened this issue Feb 28, 2018 · 17 comments

Comments

@b-wins
Copy link

b-wins commented Feb 28, 2018

Because of my application structure, I'm looking to use authorization code flow and pass the code to a backend server which will take over from there.

Does this library have any way to support that? Or ideas of a different one you played with?

Thanks,

B Wins

@bechhansen
Copy link
Contributor

Hi

There already exit an issue about this topic. #19

I have implemented a solution for supporting authorization code flow.
There is a pull request for it, #195, which have been waiting for approval since December 2017.

@manfredsteyer, any plans for merging PR's anytime soon?

@pokkia
Copy link

pokkia commented Apr 11, 2018

+1

2 similar comments
@dar88rm
Copy link

dar88rm commented Apr 11, 2018

+1

@pmartella
Copy link

+1

@darbio
Copy link
Contributor

darbio commented May 10, 2018

+1 - would be good to get this PR integrated

@manfredsteyer
Copy link
Owner

Sorry, I don't manage to support such many variation. I will focus on Implicit Flow which is the most suitable one for browser-based SPA.

Feel free to fork this library for other flows.

@bechhansen
Copy link
Contributor

Hi

I think this great library need to include the authorization code flow to be complete, and I think its sad it can’t be part of this package. I personally prefer to use the authorization code flow as I think the silent refresh mechanism of the implicit flow is a dirty hack.

I have forked this repository and added support for the authorization code flow. PKCE is currently not implemented.

Go check it out at https://www.npmjs.com/package/angular-oauth2-oidc-codeflow

(Name, versioning, structure, etc. might change in the future)

@gentunian
Copy link

Sorry, I don't manage to support such many variation. I will focus on Implicit Flow which is the most suitable one for browser-based SPA.

Feel free to fork this library for other flows.

The fact that is the most used does not invalidate that is the more insecure way of doing this.

Please have a read on these links, from https://oauth.net/2/grant-types/implicit/

It is generally not recommended to use the implicit flow (and some servers prohibit this flow entirely). In the time since the spec was originally written, the industry best practice has changed to recommend that public clients should use the authorization code flow with the PKCE extension instead.

ory hydra is a complete implementation of oauth2 RFC authorization server based on best practices and security focused:

https://www.ory.sh/oauth2-for-mobile-app-spa-browser

@RFIhism
Copy link

RFIhism commented Apr 5, 2019

Hi bechhansen!
I want to build an angular 7 web aplication protected with OAuth2-oidc-Authorization code flow,i'm traying to use your project but it is the same of manfredsteyer I mean it is implimented with the implicit-flow?

@RFIhism
Copy link

RFIhism commented Apr 5, 2019

Hi @bechhansen !
I want to build an angular 7 web aplication protected with OAuth2-oidc-Authorization code flow,i'm traying to use your project but it is the same of manfredsteyer I mean it is implimented with the implicit-flow?

@bechhansen
Copy link
Contributor

Hi @bechhansen !
I want to build an angular 7 web aplication protected with OAuth2-oidc-Authorization code flow,i'm traying to use your project but it is the same of manfredsteyer I mean it is implimented with the implicit-flow?

Hi @RFIhism
My project is a fork of this one, but I have added support for authorization code flow.
Recently manfredsteyer have uttered interest in merging the authorization code flow implementation back to the upstream branch. It has not happened yet though. Currently I'm not doing any work on my fork as I am not using it at the moment.

@RFIhism
Copy link

RFIhism commented Apr 5, 2019

Hi @bechhansen !
Thank you for your response. I understand and I wich that @manfredsteyer merge the authorization code flow to the upstream branch. But I want know if your fork project works correctly
with the authorization code flow? Because je l'ai besion at the moment when I'm working in this flow.

@bechhansen
Copy link
Contributor

Hi @bechhansen !
Thank you for your response. I understand and I wich that @manfredsteyer merge the authorization code flow to the upstream branch. But I want know if your fork project works correctly
with the authorization code flow? Because je l'ai besion at the moment when I'm working in this flow.

It should work. I have currently a solution running using it. PKCE is currently not implemented though.

@RFIhism
Copy link

RFIhism commented Apr 5, 2019

In my project,I Don't need to use the PKCE when I'm developping a web application with angular 7 and my server run in HTTPs(are secured). please can i take a look to your solution when can help me. Thanks a lot for your interest and your help.

@bechhansen
Copy link
Contributor

In my project,I Don't need to use the PKCE when I'm developping a web application with angular 7 and my server run in HTTPs(are secured). please can i take a look to your solution when can help me. Thanks a lot for your interest and your help.

Sorry, my app is not public so I can not share it. Also I might be about to stop using the library as I'm not happy with my IDP (Amazon Cognito).

Have a look at the example at https://github.com/bechhansen/angular-oauth2-oidc. This is pretty much how I use the library.

@RFIhism
Copy link

RFIhism commented Apr 8, 2019

Hi @bechhansen !

Thanks for your response. I looked your fork but you still use the implicit flow also! When you are difined it in the file "oauth-service.ts" #1066

@bechhansen
Copy link
Contributor

bechhansen commented Apr 8, 2019

Hi @bechhansen !

Thanks for your response. I looked your fork but you still use the implicit flow also! When you are difined it in the file "oauth-service.ts" #1066

@RFIhism the implicit flow is still available in the fork, but it is extended with functionality for code flow.
At the time I implemented it, the goal was to have it merged to the upstream branch. The pull-request was later rejected though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants