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

update demo app auth0 acct #1007

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-pants-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rnaa-demo': patch
---

demo app with new auth0
2 changes: 1 addition & 1 deletion docs/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Steps:
// etc...
```

2. `AppDelegate.swift` should implement the `RNAppAuthorizationFlowManager` protocol and have a handler for url deep linking. The result should look something like this:
2. `AppDelegate.swift` should implement the `RNAppAuthAuthorizationFlowManager` protocol and have a handler for url deep linking. The result should look something like this:

```swift
@UIApplicationMain
Expand Down
9 changes: 4 additions & 5 deletions examples/demo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ const configs = {
// }
},
auth0: {
// From https://openidconnect.net/
issuer: 'https://samples.auth0.com',
clientId: 'kbyuFDidLLm280LIwVFiazOqjO3ty8KH',
redirectUrl: 'https://openidconnect.net/callback',
issuer: 'https://rnaa-demo.eu.auth0.com',
clientId: 'VtXdAoGFcYzZ3IJaNy4UIS5RNHhdbKbU',
redirectUrl: 'rnaa-demo://oauthredirect',
additionalParameters: {},
scopes: ['openid', 'profile', 'email', 'phone', 'address'],
scopes: ['openid', 'profile', 'email', 'offline_access'],

// serviceConfiguration: {
// authorizationEndpoint: 'https://samples.auth0.com/authorize',
Expand Down
3 changes: 0 additions & 3 deletions examples/demo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
manifestPlaceholders = [
appAuthRedirectScheme: 'io.identityserver.demo'
]
}
signingConfigs {
debug {
Expand Down
21 changes: 20 additions & 1 deletion examples/demo/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

Expand All @@ -21,5 +21,24 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- In order to support multiple possible android redirects: https://github.com/FormidableLabs/react-native-app-auth/issues/495#issuecomment-650797187 -->
<!-- https://github.com/openid/AppAuth-Android/blob/27b62d5da94023941db545b70036a742a52b7070/README.md#capturing-the-authorization-redirect -->
<activity
android:exported="true"
android:name="net.openid.appauth.RedirectUriReceiverActivity"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="io.identityserver.demo"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="rnaa-demo"/>
</intent-filter>
</activity>
</application>
</manifest>
11 changes: 6 additions & 5 deletions examples/demo/components/Page.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import { ImageBackground, StyleSheet, SafeAreaView } from 'react-native';
import {ImageBackground, StyleSheet, SafeAreaView} from 'react-native';

const Page = ({ children }) => (
const Page = ({children}) => (
<ImageBackground
source={require('../assets/background.jpg')}
style={[styles.background, { width: '100%', height: '100%' }]}
>
style={[styles.background, {}]}>
<SafeAreaView style={styles.safe}>{children}</SafeAreaView>
</ImageBackground>
);
Expand All @@ -17,10 +16,12 @@ const styles = StyleSheet.create({
paddingTop: 40,
paddingHorizontal: 10,
paddingBottom: 10,
width: '100%',
height: '100%',
},
safe: {
flex: 1,
}
},
});

export default Page;
32 changes: 21 additions & 11 deletions examples/demo/ios/Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.your.app.identifier</string>
<key>CFBundleURLSchemes</key>
<array>
<string>io.identityserver.demo</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.your.app.identifier</string>
<key>CFBundleURLSchemes</key>
<array>
<string>rnaa-demo</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
Expand Down Expand Up @@ -51,16 +72,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.your.app.identifier</string>
<key>CFBundleURLSchemes</key>
<array>
<string>io.identityserver.demo</string>
</array>
</dict>
</array>
</dict>
</plist>