{"id":18966022,"url":"https://github.com/wso2/asgardeo-nextjs-b2b-sample-app","last_synced_at":"2026-04-25T12:32:26.283Z","repository":{"id":192985456,"uuid":"687869646","full_name":"wso2/asgardeo-nextjs-b2b-sample-app","owner":"wso2","description":"Next.JS sample web application to integrate with Asgardeo for B2B usecases.","archived":false,"fork":false,"pushed_at":"2023-09-18T05:54:00.000Z","size":1418,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":50,"default_branch":"main","last_synced_at":"2025-06-02T08:33:08.013Z","etag":null,"topics":["asgardeo","b2b","iam","nextjs","sample-app"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wso2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T07:16:12.000Z","updated_at":"2024-03-25T10:49:21.000Z","dependencies_parsed_at":"2024-11-08T14:37:09.688Z","dependency_job_id":"9485b49e-e5ca-48f0-b33b-bb709aaad992","html_url":"https://github.com/wso2/asgardeo-nextjs-b2b-sample-app","commit_stats":null,"previous_names":["wso2/asgardeo-nextjs-b2b-sample-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wso2/asgardeo-nextjs-b2b-sample-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-nextjs-b2b-sample-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-nextjs-b2b-sample-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-nextjs-b2b-sample-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-nextjs-b2b-sample-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wso2","download_url":"https://codeload.github.com/wso2/asgardeo-nextjs-b2b-sample-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fasgardeo-nextjs-b2b-sample-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asgardeo","b2b","iam","nextjs","sample-app"],"created_at":"2024-11-08T14:35:05.099Z","updated_at":"2026-04-25T12:32:26.258Z","avatar_url":"https://github.com/wso2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asgardeo-nextjs-b2b-sample-app\n\nNext.JS sample web application to integrate with Asgardeo for B2B usecases.\n\n## 👀 Live Deployment\n\nA live preview of this demo is available at\n\n1. Vercel: [https://asgardeo-b2b-nextjs-sample-app.vercel.app/](https://asgardeo-b2b-nextjs-sample-app.vercel.app/)\n\nSample Credentials:\n\n- organization name : Best Car Mart\n- username : Alex@gmail.com\n- password : Alex@123\n\n## Features/ Capabilities\n\n- Sign In to the sub organization application\n- Sign Out of the application\n- User profile view and update\n- User Management.\n  - View all users\n  - Add new user\n  - Edit user\n  - Delete User\n- Group Management\n  - View groups\n  - Add a new group and assign users.\n  - Edit group and edit assigned users.\n  - Delete group\n- Role Management\n  - View Role permission\n  - View assigned groups\n  - Assign new groups\n  - Assign external groups\n- Idp Management\n  - Add Idp ( Google Idp/ Enterprise Idp)\n  - Edit Idp settings\n  - Add external groups\n  - Add Idp to application login flow\n\n## Configure Asgardeo to integrate with your application\n\n### Create a sub organization\n\n1. Access Asgardeo at https://console.asgardeo.io/ and log in.\n\n2. Click **Sub Organizations** in the left navigation menu.\n\n3. Create a new sub organization\n   \u003cimg src=\"./images/docs/subOrg.png\" alt=\"SubOrg\" title=\"SubOrg\"\u003e\n\nRefer Documentation : [Set up sub organizations](https://wso2.com/asgardeo/docs/guides/organization-management/manage-b2b-organizations/manage-suborganizations/#prerequisites)\n\n### Create the application\n\n1. Click **Applications** in the left navigation menu.\n\n2. Create a new application\n\n- Select Standard-Based Application.\n  \u003cimg src=\"./images/docs/applications.png\" alt=\"Applications\" title=\"Applications\"\u003e\n\n- Fill the details and click register.\n  - name : **Guardio-App**\n  - click management application.\n  - Click **Share Application** button, select the suborganizations with which you want to share the application, and proceed.\n  - Select **Share with all sub-organizations**, if you want to share your application with all existing suborganizations and every sub-organization that will be created later.\n\n3. Go to Protocol section and add the following.\n\n\u003e | Property                 |                                      Value/s                                      |\n\u003e | ------------------------ | :-------------------------------------------------------------------------------: |\n\u003e | Allowed Grant types      |                           `Organization Switch`, `Code`                           |\n\u003e | Authorized redirect URLs | `http://localhost:3001/api/auth/callback/wso2isAdmin` and `http://localhost:3001` |\n\u003e | Allowed origin           |                              `http://localhost:3001`                              |\n\n\u003cimg src=\"./images/docs/protocol.png\" alt=\"Protocol\" title=\"Protocol\"\u003e\n\n4. On the User Attributes tab, click on + Add User Attributes.\n   Select `Email`, `First Name`, `Last Name`, and `Username` from the list of attributes. |\n\nRefer Documentation : [Share applications with sub organizations\n](https://wso2.com/asgardeo/docs/guides/organization-management/manage-b2b-organizations/share-applications/)\n\n### Create a user and assign roles\n\nYou need to create new users on the sub-organizations with the required permissions.\nTo create a user for Best Auto Mart with all administrative permissions :\n\n1. Click Sub Organization at left navigation panel\n2. Use the Organization Switcher to change the organization to Best Car Mart.\n3. Click **User Management** at the left navigation panel and select Users.\n   \u003cimg src=\"./images/docs/users.png\" alt=\"Users\" title=\"Users\"\u003e\n\n4. Click Add User button and create a user named Alex on the Best Car Mart organization.\n5. Create an admin role with all permissions.\n6. Click User Management \u003e Roles \u003e Organization Roles\u003e Configure.\n   \u003cimg src=\"./images/docs/organizationRoles.png\" alt=\"organizationRoles\" title=\"organizationRoles\"\u003e\n\n7. Click Add Organization Role button and create an administrator role.\n8. Click next and check all permissions to assign all the permissions to the created role.\n9. Click next and select the users tab.\n10. Check the checkbox alex and select the front arrow to assign the user to the role.\n    \u003cimg src=\"./images/docs/userRole.png\" alt=\"userRole\" title=\"userRole\"\u003e\n\n11. create another user named Tom on the Best Auto Mart organization( without assiging roles)\n\nRefer Documentation : [Onboard sub organization administrators.\n](https://wso2.com/asgardeo/docs/guides/organization-management/manage-b2b-organizations/onboard-sub-org-admins/#sales-led-approach)\n\n## 🚀 Getting Started\n\n1. Clone the repository.\n\n```bash\ngit clone https://github.com/ChanikaRuchini/asgardeo-b2b-nextjs-sample-app.git\n```\n\n2. Install the dependencies.\n\n```bash\nnpm install\n```\n\n3. Create a `.env` file based on the `.env.example` file.\n\n```bash\ncp .env.example .env\n```\n\n4. Update the values in the `.env` file based on your requirements.\n\n```bash\n\n# The endpoint of the server's API that the client application will communicate with\n# E.g., http://localhost:3000\nNEXT_PUBLIC_HOSTED_URL=\"http://localhost:3000\"\n\n# The base URL for the Asgardeo root organization's API\n# E.g., https://api.asgardeo.io/t/your-org\nNEXT_PUBLIC_ASGARDEO_BASE_ORGANIZATION_URL=\"https://api.asgardeo.io/t/guardioinc\"\n\n# The client ID for the Asgardeo Shared Application\nSHARED_APP_CLIENT_ID=\"\u003cCLIENT ID OF CREATED APP\u003e\"\n\n# The client Secret for the Asgardeo Shared Application\nSHARED_APP_CLIENT_SECRET=\"\u003cCLIENT SECRET OF CREATED APP\u003e\"\n\n# The name of the Asgardeo Shared Application\nSHARED_APPICATION_NAME=\"Guardio-App\"\n\n```\n\n5. Start the development server.\n\n```bash\nnpm run dev\n```\n\nThis will start the app on [http://localhost:3000](http://localhost:3000).\nLogin from the created user `Alex` to the application.\n\n- Type `Best Car Mart` when pop up to type the organization.\n\n## Deploy the application\n\nGo through the following guides and deploy your application in Vercel, Netlify and Choreo.\nVercel : https://vercel.com/guides/deploying-react-with-vercel\nNetlify : https://www.netlify.com/with/nextjs/\nChoreo : https://wso2.com/choreo/docs/quick-start-guides/build-your-first-cloud-native-application-with-choreo/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fasgardeo-nextjs-b2b-sample-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwso2%2Fasgardeo-nextjs-b2b-sample-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fasgardeo-nextjs-b2b-sample-app/lists"}