Skip to content
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

feat: OIDC4VCI Authorization code flow - Support for Wallet Initiated flow #1369

Conversation

mishasizov-SK
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the cla-signed label Jul 14, 2023
@@ -229,6 +236,186 @@ func (s *Service) RunOIDC4CI(config *OIDC4CIConfig, hooks *Hooks) error {
return nil
}

func extractWalletInitiatedFlowParams(scopes []string) *walletInitiatedFlowParams {
for _, scope := range scopes {
chunks := strings.Split(scope, "||")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass only issuerURL. Do not need to crete combined string that includes claimsEndpoint and credentialTemplateID

"scopes": [
"openid",
"profile",
"https://api-gateway.trustbloc.local:5566/issuer/bank_issuer/v1.0||https://mock-login-consent.example.com:8099/claim-data?credentialType=UniversityDegreeCredential||universityDegreeTemplateID"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need to keep claimsEndpoint and templateID as a part of the scope. Only issuerURL.

Comment on lines +278 to +284
//if parsedURL, err := url.Parse(scope); err != nil || parsedURL.Host == "" {
// continue
//}
chunks := strings.Split(scope, "||")
if len(chunks) != 3 {
continue
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check only if one of the scopes is issuerURL.

}

//todo: make a call to well-known.
//issuerOidcConfiguration, err := s.getIssuerOIDCConfig(chunks[0])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get issuer issuerOidcConfiguration. If issuerOidcConfiguration.WalletInitiatedAuthFlowSupported - then take credentialURL from issuerOidcConfiguration

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 40.09% and project coverage change: -1.14 ⚠️

Comparison is base (02aad4f) 87.54% compared to head (ca93627) 86.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1369      +/-   ##
==========================================
- Coverage   87.54%   86.41%   -1.14%     
==========================================
  Files         149      149              
  Lines        9040     9178     +138     
==========================================
+ Hits         7914     7931      +17     
- Misses        739      855     +116     
- Partials      387      392       +5     
Impacted Files Coverage Δ
pkg/restapi/v1/issuer/controller.go 84.74% <25.92%> (-4.07%) ⬇️
pkg/restapi/v1/oidc4ci/controller.go 84.62% <28.84%> (-6.36%) ⬇️
pkg/service/oidc4ci/oidc4ci_service.go 74.28% <34.04%> (-20.96%) ⬇️
...rvice/oidc4ci/oidc4ci_service_initiate_issuance.go 91.62% <89.47%> (-1.00%) ⬇️
...g/service/oidc4ci/oidc4ci_service_exchange_code.go 100.00% <100.00%> (ø)
...service/oidc4ci/oidc4ci_service_store_auth_code.go 100.00% <100.00%> (ø)
...storage/mongodb/oidc4cinoncestore/oidc4vc_store.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sudeshrshetty sudeshrshetty merged commit ca93627 into trustbloc:main Jul 18, 2023
6 of 9 checks passed
@mishasizov-SK mishasizov-SK deleted the feat_OIDC4VCI_Authorization_code_flow_-_Support_for_Wallet_Initiated_flow branch August 29, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants